comparison UI/UIHouses.cpp @ 1747:cecb080929c4

Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
author Grumpy7
date Mon, 30 Sep 2013 05:48:32 +0200
parents 8251e59fd7c1
children 19684d4bbe9a
comparison
equal deleted inserted replaced
1738:ef86fc6d6a80 1747:cecb080929c4
831 else 831 else
832 { 832 {
833 //v10 = uHouseID; 833 //v10 = uHouseID;
834 if ( (signed int)uHouseID < 53 ) //entering shops and guilds 834 if ( (signed int)uHouseID < 53 ) //entering shops and guilds
835 { 835 {
836 if ( !(pParty->field_3C._shop_ban_times[uHouseID]) 836 if ( !(pParty->PartyTimes._shop_ban_times[uHouseID])
837 || (pParty->field_3C._shop_ban_times[uHouseID] <= pParty->uTimePlayed) ) 837 || (pParty->PartyTimes._shop_ban_times[uHouseID] <= pParty->uTimePlayed) )
838 { 838 {
839 pParty->field_3C._shop_ban_times[uHouseID] = 0; 839 pParty->PartyTimes._shop_ban_times[uHouseID] = 0;
840 } 840 }
841 else 841 else
842 { 842 {
843 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!" 843 ShowStatusBarString(pGlobalTXT_LocalizationStrings[191], 2u);// "You've been banned from this shop!"
844 return 0; 844 return 0;
1089 case BuildingType_DarkGuild: 1089 case BuildingType_DarkGuild:
1090 case BuildingType_ElementalGuild: 1090 case BuildingType_ElementalGuild:
1091 case BuildingType_SelfGuild: 1091 case BuildingType_SelfGuild:
1092 case BuildingType_16: 1092 case BuildingType_16:
1093 { 1093 {
1094 if ( pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C] >= (signed __int64)pParty->uTimePlayed ) 1094 if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] >= (signed __int64)pParty->uTimePlayed )
1095 { 1095 {
1096 for ( uint i = 0; i < 12; ++i ) 1096 for ( uint i = 0; i < 12; ++i )
1097 { 1097 {
1098 if ( pParty->SpellBooksInGuilds[v8->par1C-139][i].uItemID ) 1098 if ( pParty->SpellBooksInGuilds[v8->par1C-139][i].uItemID )
1099 { 1099 {
1104 } 1104 }
1105 } 1105 }
1106 else//generation new books 1106 else//generation new books
1107 { 1107 {
1108 SpellBookGenerator(); 1108 SpellBookGenerator();
1109 pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000 1109 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
1110 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); 1110 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
1111 } 1111 }
1112 break; 1112 break;
1113 } 1113 }
1114 case BuildingType_TownHall: 1114 case BuildingType_TownHall:
1115 { 1115 {
1116 if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_MESSAGE ) 1116 if ( uMessageParam == HOUSE_DIALOGUE_TOWNHALL_MESSAGE )
1117 { 1117 {
1118 if ( pParty->field_3C.bountyHunting_next_generation_time[(int)((char *)v8->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed )//new generation 1118 if ( pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)v8->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed )//new generation
1119 { 1119 {
1120 pParty->monster_for_hunting_killed[(int)((char *)v8->ptr_1C - 102)] = false; 1120 pParty->monster_for_hunting_killed[(int)((char *)v8->ptr_1C - 102)] = false;
1121 pParty->field_3C.bountyHunting_next_generation_time[(int)((char *)v8->ptr_1C - 102)] = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); 1121 pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)v8->ptr_1C - 102)] = (signed __int64)((double)(309657600 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335);
1122 pParty->monster_id_for_hunting[(int)((char *)v8->ptr_1C - 102)] = rand() % 258 + 1; 1122 pParty->monster_id_for_hunting[(int)((char *)v8->ptr_1C - 102)] = rand() % 258 + 1;
1123 v16 = (int)((char *)window_SpeakInHouse->ptr_1C - 102); 1123 v16 = (int)((char *)window_SpeakInHouse->ptr_1C - 102);
1124 if ( !v16 ) 1124 if ( !v16 )
1125 { 1125 {
1126 while ( 1 ) 1126 while ( 1 )
1601 break; 1601 break;
1602 } 1602 }
1603 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD: 1603 case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
1604 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL: 1604 case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
1605 { 1605 {
1606 if ( pParty->field_3C.Shops_next_generation_time[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed ) 1606 if ( pParty->PartyTimes.Shops_next_generation_time[(unsigned int)v8->ptr_1C] < (signed __int64)pParty->uTimePlayed )
1607 { 1607 {
1608 GenerateStandartShopItems(); 1608 GenerateStandartShopItems();
1609 GenerateSpecialShopItems(); 1609 GenerateSpecialShopItems();
1610 pParty->field_3C.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335); 1610 pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(11059200 * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
1611 } 1611 }
1612 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD ) 1612 if ( uMessageParam == HOUSE_DIALOGUE_SHOP_BUY_STANDARD )
1613 { 1613 {
1614 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] ) 1614 if ( uItemsAmountPerShopType[p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].uType] )
1615 { 1615 {