Mercurial > mm7
changeset 1861:a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
author | Grumpy7 |
---|---|
date | Mon, 14 Oct 2013 06:32:30 +0200 |
parents | 3186f469323a |
children | a2bdc17ffd2f |
files | Actor.cpp Actor.h CastSpellInfo.cpp Events.cpp Game.cpp NPC.cpp Party.cpp Party.h Player.cpp TurnEngine.cpp UI/UICharacter.cpp mm7_2.cpp mm7_3.cpp mm7_4.cpp mm7_5.cpp mm7_6.cpp |
diffstat | 16 files changed, 95 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/Actor.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/Actor.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -200,7 +200,7 @@ } //----- (00404AC7) -------------------------------------------------------- -void __fastcall Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel) +void Actor::AI_SpellAttack(unsigned int uActorID, AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel) { Actor *actorPtr; // esi@1 unsigned int realPoints; // edi@1 @@ -749,14 +749,15 @@ v2 = (a1->pMonsterInfo.uID - 1) / 3 + 1; if ( !v3 ) v3 = (a2->pMonsterInfo.uID - 1) / 3 + 1; - if ( (signed int)v2 >= 39 && (signed int)v2 <= 44 && (signed int)v3 >= 39 && (signed int)v3 <= 44 - || (signed int)v2 >= 45 && (signed int)v2 <= 50 && (signed int)v3 >= 45 && (signed int)v3 <= 50 - || (signed int)v2 >= 51 && (signed int)v2 <= 62 && (signed int)v3 >= 51 && (signed int)v3 <= 62 - || (signed int)v2 >= 78 && (signed int)v2 <= 83 && (signed int)v3 >= 78 && (signed int)v3 <= 83 ) - result = 1; + if ( v2 >= 39 && v2 <= 44 && v3 >= 39 && v3 <= 44 + || v2 >= 45 && v2 <= 50 && v3 >= 45 && v3 <= 50 + || v2 >= 51 && v2 <= 62 && v3 >= 51 && v3 <= 62 + || v2 >= 78 && v2 <= 83 && v3 >= 78 && v3 <= 83 + || v2 == v3 + ) + return true; else - result = v2 == v3; - return result; + return false; } //----- (0043AC45) -------------------------------------------------------- @@ -766,13 +767,15 @@ int v5; // ST1C_4@8 int v6; // eax@8 - auto victim = &pActors[uActorID]; + int x = 0; BYTE2(x) |= 8u; + int y = 0; y |= 0x80000; + Actor* victim = &pActors[uActorID]; if ( a2 == 1 ) - BYTE2(victim->uAttributes) |= 8u; + victim->uAttributes |= 0x80000; for (uint i = 0; i < uNumActors; ++i) { - auto actor = &pActors[i]; + Actor* actor = &pActors[i]; if (!actor->CanAct() || i == uActorID) continue; @@ -785,7 +788,8 @@ { actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long; if ( a2 == 1 ) - BYTE2(actor->uAttributes) |= 8u; + actor->uAttributes |= 0x80000; + } } }
--- a/Actor.h Mon Oct 14 03:22:34 2013 +0200 +++ b/Actor.h Mon Oct 14 06:32:30 2013 +0200 @@ -230,7 +230,7 @@ static struct AIDirection *__fastcall GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, struct AIDirection *pOut, int a4); static signed int __fastcall Explode(unsigned int uActorID); static char __fastcall AI_RangedAttack(unsigned int uActorID, struct AIDirection *a2, int type, char a4); - static void __fastcall AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel); + static void AI_SpellAttack(unsigned int uActorID, struct AIDirection *pDir, int uSpellID, int a4, unsigned int uSkillLevel); static unsigned short GetObjDescId( int spellId );
--- a/CastSpellInfo.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/CastSpellInfo.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1115,7 +1115,7 @@ } if ( pPlayer->CanCastSpell(uRequiredMana) ) { - v92 = pParty->pPlayers;//[0].pConditions[1]; + v92 = pParty->pPlayers.data();//[0].pConditions[1]; LODWORD(v727) = 1; do { @@ -1174,7 +1174,7 @@ } v105 = 0; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v730b = pParty->pPlayers;//[0].pPlayerBuffs[1]; + v730b = pParty->pPlayers.data();//[0].pPlayerBuffs[1]; do { pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, v105); @@ -2373,7 +2373,7 @@ } a2 = 0; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v357 = pParty->pPlayers;//[0].pPlayerBuffs[11]; + v357 = pParty->pPlayers.data();//[0].pPlayerBuffs[11]; do { pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2); @@ -3232,7 +3232,7 @@ amount = 5 * v2 + 10; if ( !pPlayer->CanCastSpell(uRequiredMana) ) break; - v501 = pParty->pPlayers; + v501 = pParty->pPlayers.data(); int v1 = 0; do { @@ -3241,7 +3241,7 @@ ++v501; ++v1; } - while ( (signed int)v501 < (signed int)pParty->pHirelings ); + while ( (signed int)v501 < (signed int)pParty->pHirelings.data() ); LODWORD(v727) = 1; break; } @@ -3468,7 +3468,7 @@ v732 = (300 * amount * v2 + 60) << 7; v730 = v2 + 5; int _v726 = 0; - v553 = pParty->pPlayers;//[0].pConditions[1]; + v553 = pParty->pPlayers.data();//[0].pConditions[1]; *((float *)&v733) = (double)v732 * 0.033333335; do { @@ -3799,7 +3799,7 @@ int _v733 = 0; memset(&achieved_awards, 0, 4000); int i = 0; - pNPCData = pParty->pHirelings; + pNPCData = pParty->pHirelings.data(); do { if ( pNPCData->pName != 0) @@ -3851,7 +3851,7 @@ //*(int *)((char *)&pParty->pPlayers[3].pInstalledBeacons[3].field_18 + v610) = 1; pParty->pHirelings[v609-1].evt_A = 1; - v612 = pParty->pPlayers; + v612 = pParty->pPlayers.data(); do { v612->sHealth = v612->GetMaxHealth(); @@ -3891,7 +3891,7 @@ } a2 = 0; v717 = (signed int)(signed __int64)((double)(signed int)((int)v733 << 7) * 0.033333335); - v619 = pParty->pPlayers;//[0].pPlayerBuffs[10]; + v619 = pParty->pPlayers.data();//[0].pPlayerBuffs[10]; do { pGame->GetStru6()->SetPlayerBuffAnim(pCastSpell->uSpellID, a2);
--- a/Events.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/Events.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1188,13 +1188,13 @@ //v7 = ""; break; } - v87 = pParty->pPlayers; + v87 = pParty->pPlayers.data(); do { v87->ReceiveDamage(v85, (DAMAGE_TYPE)_evt->v6); ++v87; } - while ( (signed int)v87 < (signed int)pParty->pHirelings ); + while ( (signed int)v87 < (signed int)pParty->pHirelings.data() ); ++curr_seq_num; v4 = v124;
--- a/Game.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/Game.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -450,19 +450,19 @@ pVideoPlayer->Unload(); SaveGame(0, 0); ++pParty->uNumDeaths; - pPlayer = pParty->pPlayers; + pPlayer = pParty->pPlayers.data(); do { pPlayer->SetVariable(VAR_Award, 85); ++pPlayer; } - while ( (signed int)pPlayer < (signed int)pParty->pHirelings ); + while ( (signed int)pPlayer < (signed int)pParty->pHirelings.data() ); pParty->days_played_without_rest = 0; pParty->uTimePlayed += 0x276000ui64; LOWORD(pParty->uFlags) &= ~0x204; pParty->SetGold(0); pOtherOverlayList->Reset(); - memset(pParty->pPartyBuffs, 0, 0x140u); + memset(pParty->pPartyBuffs.data(), 0, 0x140u); if ( pParty->bTurnBasedModeOn == 1 ) {
--- a/NPC.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/NPC.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1438,13 +1438,13 @@ if ( uMessageParam == 82 && contract_approved ) //join guild { Party::TakeGold(gold_transaction_amount); - v4 = pParty->pPlayers; + v4 = pParty->pPlayers.data(); do { v4->SetVariable(VAR_Award, dword_F8B1AC_award_bit_number); ++v4; } - while ( (signed int)v4 < (signed int)pParty->pHirelings ); + while ( (signed int)v4 < (signed int)pParty->pHirelings.data() ); switch ( dword_F8B1D8 ) { case 19: @@ -1531,7 +1531,7 @@ } else { - memcpy(pParty->pHirelings, pCurrentNPCInfo, 0x4Cu); + memcpy(pParty->pHirelings.data(), pCurrentNPCInfo, 0x4Cu); v24 = pCurrentNPCInfo->pName; v22 = pParty->pHireling1Name; } @@ -1834,7 +1834,7 @@ v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; v4 = 0; v5 = 0; - v6 = pParty->pHirelings; + v6 = pParty->pHirelings.data(); do { if ( v6->pName )
--- a/Party.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/Party.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -99,10 +99,10 @@ uNumDeaths = 0; uNumPrisonTerms = 0; uNumBountiesCollected = 0; - memset(monster_for_hunting_killed, 5, sizeof(__int16)); - memset(monster_id_for_hunting, 5, sizeof(__int16)); + memset(monster_for_hunting_killed.data(), 5, sizeof(__int16)); + memset(monster_id_for_hunting.data(), 5, sizeof(__int16)); memset(_quest_bits, 64, sizeof(__int8)); - memset(pArcomageWins, 16, sizeof(__int8)); + memset(pArcomageWins.data(), 16, sizeof(__int8)); uNumArenaPageWins = 0; uNumArenaSquireWins = 0; uNumArenaKnightWins = 0; @@ -293,7 +293,7 @@ pHireling1Name[0] = 0; pHireling2Name[0] = 0; this->hirelingScrollPosition = 0; - memset(pHirelings, 0, 2 * sizeof(*pHirelings)); + memset(pHirelings.data(), 0, 2 * sizeof(NPCData)); strcpy(this->pPlayers[0].pName, pGlobalTXT_LocalizationStrings[509]); //Zoltan this->pPlayers[0].uPrevFace = 17; @@ -492,7 +492,7 @@ bTurnBasedModeOn = false; uActiveCharacter = 1; - ::pPlayers.ZerothIndex() = pPlayers; + ::pPlayers.ZerothIndex() = &pPlayers[0]; for (uint i = 0; i < 4; ++i) ::pPlayers[i + 1] = &pPlayers[i]; @@ -554,7 +554,7 @@ uFlags = 0; memset(_autonote_bits, 0, 26); memset(_quest_bits, 0, 64); - memset(pIsArtifactFound, 0, 29); + memset(pIsArtifactFound.data(), 0, 29); _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1); _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1); _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1); @@ -562,7 +562,7 @@ _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1); _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1); - memset(PartyTimes._shop_ban_times,0,53*sizeof(__int64)); + memset(PartyTimes._shop_ban_times.data(),0,53*sizeof(__int64)); memcpy(pNPCStats->pNewNPCData, pNPCStats->pNPCData, 0x94BCu); memcpy(pNPCStats->pGroups_copy, pNPCStats->pGroups, 0x66u);
--- a/Party.h Mon Oct 14 03:22:34 2013 +0200 +++ b/Party.h Mon Oct 14 06:32:30 2013 +0200 @@ -2,6 +2,7 @@ #include "Player.h" #include "NPC.h" #include "mm7_data.h" +#include <array> @@ -150,14 +151,12 @@ #pragma pack(push, 1) struct PartyTimeStruct { - //__int64 field_0[10]; - __int64 bountyHunting_next_generation_time[10]; - // int field_50[170]; - __int64 Shops_next_generation_time[85];//field_50 - __int64 _shop_ban_times[53]; - unsigned __int64 CounterEventValues[10]; // (0xACD314h in Silvo's binary) - __int64 HistoryEventTimes[29]; // (0xACD364h in Silvo's binary) - unsigned __int64 _s_times[20]; //5d8 440h+8*51 //(0xACD44Ch in Silvo's binary) + std::array<__int64, 10> bountyHunting_next_generation_time; + std::array<__int64, 85> Shops_next_generation_time;//field_50 + std::array<__int64, 53> _shop_ban_times; + std::array<unsigned __int64, 10> CounterEventValues; // (0xACD314h in Silvo's binary) + std::array<__int64, 29> HistoryEventTimes; // (0xACD364h in Silvo's binary) + std::array<unsigned __int64, 20> _s_times; //5d8 440h+8*51 //(0xACD44Ch in Silvo's binary) }; #pragma pack(pop) @@ -269,42 +268,42 @@ int uNumPrisonTerms; unsigned int uNumBountiesCollected; int field_74C; - __int16 monster_id_for_hunting[5]; - __int16 monster_for_hunting_killed[5]; + std::array<__int16, 5> monster_id_for_hunting; + std::array<__int16, 5> monster_for_hunting_killed; unsigned char days_played_without_rest; unsigned __int8 _quest_bits[64]; - unsigned __int8 pArcomageWins[16]; + std::array<unsigned __int8, 16> pArcomageWins; char field_7B5_in_arena_quest; char uNumArenaPageWins; char uNumArenaSquireWins; char uNumArenaKnightWins; char uNumArenaLordWins; - char pIsArtifactFound[29]; //7ba - char field_7d7[39]; + std::array<char, 29> pIsArtifactFound; //7ba + std::array<char, 39> field_7d7; unsigned char _autonote_bits[26]; - char field_818[60]; - char field_854[32]; + std::array<char, 60> field_818; + std::array<char, 32> field_854; int uNumArcomageWins; int uNumArcomageLoses; unsigned int bTurnBasedModeOn; int field_880; int uFlags2; PartyAlignment alignment; - SpellBuff pPartyBuffs[20]; - Player pPlayers[4]; - NPCData pHirelings[2]; + std::array<SpellBuff, 20> pPartyBuffs; + std::array<Player, 4> pPlayers; + std::array<NPCData, 2> pHirelings; ItemGen pPickedItem; unsigned int uFlags; - ItemGen StandartItemsInShops[53][12]; - ItemGen SpecialItemsInShops[53][12]; //D0EC - ItemGen SpellBooksInGuilds[32][12]; - char field_1605C[24]; + std::array<std::array<ItemGen, 12>, 53> StandartItemsInShops; + std::array<std::array<ItemGen, 12>, 53> SpecialItemsInShops; //D0EC + std::array<std::array<ItemGen, 12>, 32> SpellBooksInGuilds; + std::array<char, 24> field_1605C; char pHireling1Name[100]; char pHireling2Name[100]; int armageddon_timer; int field_16140; - int pTurnBasedPlayerRecoveryTimes[4]; - int InTheShopFlags[53]; + std::array<int, 4> pTurnBasedPlayerRecoveryTimes; + std::array<int, 53> InTheShopFlags; int uFine; float flt_TorchlightColorR; float flt_TorchlightColorG;
--- a/Player.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/Player.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -7026,7 +7026,7 @@ } } if ( pParty->pHirelings[0].uProfession == pValue ) - memset(pParty->pHirelings, 0, sizeof(NPCData)); + memset(pParty->pHirelings.data(), 0, sizeof(NPCData)); if ( pParty->pHirelings[1].uProfession == pValue ) memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); pParty->hirelingScrollPosition = 0;
--- a/TurnEngine.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/TurnEngine.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -135,7 +135,7 @@ pEventTimer->TrackGameTime(); pAudioPlayer->StopChannels(-1, -1); pAudioPlayer->PlaySound(SOUND_207, 0, 0, -1, 0, 0, 0, 0); - pPlayer = pParty->pPlayers; + pPlayer = pParty->pPlayers.data(); dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength; dword_50C994 = 0;
--- a/UI/UICharacter.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/UI/UICharacter.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1767,7 +1767,7 @@ memset(byte_5111F6.data(), 0, sizeof(byte_5111F6)); for (uint i = 0; i < 4; ++i) { - auto player = pParty->pPlayers + i; + auto player = &pParty->pPlayers[i]; if (player->HasItem(ITEM_ARTIFACT_GOVERNORS_ARMOR, 1)) byte_5111F6[0] = 1; if (player->HasItem(ITEM_ARTIFACT_YORUBA, 1)) byte_5111F6[1] = 1;
--- a/mm7_2.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/mm7_2.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -310,14 +310,14 @@ if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0) { uDialogueType = 91; - v4 = pParty->pPlayers; + v4 = pParty->pPlayers.data(); ++*((char *)&pParty->monster_for_hunting_killed[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1); do { v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3); ++v4; } - while ( (signed int)v4 < (signed int)pParty->pHirelings ); + while ( (signed int)v4 < (signed int)pParty->pHirelings.data() ); pParty->PartyFindsGold(gold_transaction_amount, 0); pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); pParty->field_7B5_in_arena_quest = -1; @@ -442,7 +442,7 @@ ++pMessageQueue_50CBD0->uNumMessages; }*/ pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); - v2 = pParty->pPlayers; + v2 = pParty->pPlayers.data(); do { v3 = v2->GetActualLevel(); @@ -454,7 +454,7 @@ } ++v2; } - while ( (signed int)v2 < (signed int)pParty->pHirelings ); + while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); if ( uDialogueType == 85 ) { num_monsters = v4; @@ -734,11 +734,11 @@ v19 = 1; pRenderer->BeginScene(); pWindow.DrawTitleText(pFont, 1u, 0x23u, 1u, pGlobalTXT_LocalizationStrings[9], 3u); - v3 = pParty->pPlayers;//[0].pName; + v3 = pParty->pPlayers.data();//[0].pName; v23 = 0i64; v20 = 0; //for ( i = (int)pParty->pPlayers[0].pName; ; v3 = (char *)i ) - for ( i = pParty->pPlayers; ; v3 = i ) + for ( i = pParty->pPlayers.data(); ; v3 = i ) { v4 = pClassNames[v3->classType]; v5 = v3->GetBaseLevel();
--- a/mm7_3.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/mm7_3.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1611,7 +1611,7 @@ pParty->uFlags &= ~PARTY_FLAGS_1_LANDING; else for (uint i = 0; i < 4; ++i) { // receive falling damage - auto player = pParty->pPlayers + i; + auto player = &pParty->pPlayers[i]; if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS)) { player->ReceiveDamage((pParty->uFallStartY - party_z) * (0.1f * player->GetMaxHealth()) / 256, DMGT_PHISYCAL); @@ -2205,7 +2205,7 @@ } else for (int _i = 0; _i < 4; ++_i) // receive falling damage { - auto player = pParty->pPlayers + _i; + auto player = &pParty->pPlayers[_i]; if ( !player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) ) { @@ -2637,7 +2637,7 @@ { // falling scream for (int i = 0; i < 4; ++i) { - auto player = pParty->pPlayers + i; + auto player = &pParty->pPlayers[i]; if (!player->HasEnchantedItemEquipped(72) && !player->WearsItem(ITEM_ARTIFACT_HERMES_SANDALS, EQUIP_BOOTS) && player->CanAct()) player->PlaySound(SPEECH_66, 0); }
--- a/mm7_4.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/mm7_4.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -454,7 +454,7 @@ struct IDirectDrawSurface *v11; // eax@23 int v12; // eax@26 - v0 = pParty->pPlayers; + v0 = pParty->pPlayers.data(); do { if (SoundSetAction[24][0]) @@ -499,7 +499,7 @@ } ++v0; } - while ( (signed int)v0 < (signed int)pParty->pHirelings ); + while ( (signed int)v0 < (signed int)pParty->pHirelings.data() ); v6 = pIcons_LOD->uNumLoadedFiles - 1; if ( v6 >= pIcons_LOD->pFacesLock ) { @@ -1043,7 +1043,7 @@ if (pParty->days_played_without_rest > 3) for (uint i = 0; i < 4; ++i) { - Player* player = pParty->pPlayers + i; + Player* player = &pParty->pPlayers[i]; player->Zero(); @@ -2870,7 +2870,7 @@ if ( (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, *v0) ) { v1 = 0; - v2 = pParty->pPlayers; + v2 = pParty->pPlayers.data(); do { LOBYTE(v3) = v2->CompareVariable(VAR_PlayerItemInHands, *(v0+1)); @@ -2879,7 +2879,7 @@ ++v2; ++v1; } - while ( (signed int)v2 < (signed int)pParty->pHirelings ); + while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); if ( v1 == 4 ) break; } @@ -2898,14 +2898,14 @@ if ( contract_approved == 601 ) { v5 = 0; - v12 = pParty->pPlayers;//[0].uClass; + v12 = pParty->pPlayers.data();//[0].uClass; v9 = 0; while ( 1 ) { if ( v12->classType == PLAYER_CLASS_LICH ) { v10 = 0; - v6 = pParty->pPlayers;//[0].pInventoryItems[0].field_1A; + v6 = pParty->pPlayers.data();//[0].pInventoryItems[0].field_1A; do { v7 = v6->pInventoryItemList.data(); @@ -3438,7 +3438,7 @@ } if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) { - v11 = pParty->pHirelings; + v11 = pParty->pHirelings.data(); memset(v11, 0, sizeof(NPCData)); } else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) ) @@ -3489,7 +3489,7 @@ } else { - memcpy(pParty->pHirelings, speakingNPC, 0x4Cu); + memcpy(pParty->pHirelings.data(), speakingNPC, 0x4Cu); v15 = speakingNPC->pName; v13 = pParty->pHireling1Name; } @@ -3547,7 +3547,7 @@ } if ( pParty->pHirelings[0].pName && !_stricmp(pParty->pHirelings[0].pName, speakingNPC->pName) ) { - v11 = pParty->pHirelings; + v11 = pParty->pHirelings.data(); memset(v11, 0, sizeof(NPCData)); } else if ( pParty->pHirelings[1].pName && !_stricmp(pParty->pHirelings[1].pName, speakingNPC->pName) )
--- a/mm7_5.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/mm7_5.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -1704,26 +1704,26 @@ pParty->RestAndHeal(); if ( ((pParty->uNumFoodRations - (signed int)GetTravelTime()) & 0x80000000u) != 0 ) { - pPlayer7 = pParty->pPlayers; + pPlayer7 = pParty->pPlayers.data(); do { pPlayer7->SetCondition(1, 0); ++pPlayer7; } - while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings ); + while ( (signed int)pPlayer7 < (signed int)pParty->pHirelings.data() ); ++pParty->days_played_without_rest; } Party::TakeFood((unsigned int)GetTravelTime()); } else { - pPlayer8 = pParty->pPlayers; + pPlayer8 = pParty->pPlayers.data(); do { pPlayer8->SetCondition(1, 0); ++pPlayer8; } - while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings ); + while ( (signed int)pPlayer8 < (signed int)pParty->pHirelings.data() ); ++pParty->days_played_without_rest; } pPaletteManager->ResetNonLocked(); @@ -3279,7 +3279,7 @@ if ( pMessageQueue_50CBD0->uNumMessages ) { - pPlayer = pParty->pPlayers; + pPlayer = pParty->pPlayers.data(); do { int param2; @@ -3748,7 +3748,7 @@ if ( sub_407A1C(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z + pParty->sEyelevel, v25) ) { v26 = 0; - v27 = pParty->pPlayers;//[0].pConditions[15]; + v27 = pParty->pPlayers.data();//[0].pConditions[15]; do { if ( !(HIDWORD(v27->pConditions[14]) | LODWORD(v27->pConditions[14])) && !v27->pConditions[15] && !v27->pConditions[16] )
--- a/mm7_6.cpp Mon Oct 14 03:22:34 2013 +0200 +++ b/mm7_6.cpp Mon Oct 14 06:32:30 2013 +0200 @@ -429,13 +429,13 @@ } case 80: { - v6 = pParty->pPartyBuffs; + v6 = pParty->pPartyBuffs.data(); while ( (signed __int64)v6->uExpireTime <= 0 ) { ++v6; if ( v6 > &pParty->pPartyBuffs[PARTY_BUFF_WIZARD_EYE] ) { - v7 = pParty->pPlayers;//[0].pPlayerBuffs; + v7 = pParty->pPlayers.data();//[0].pPlayerBuffs; v8 = 0; v9 = v7->pPlayerBuffs.data(); while ( v9->uExpireTime <= 0i64 )