Mercurial > mm7
changeset 2256:27f2a2c2fd8f
_46A89E_immolation_effect moved into Party
author | Grumpy7 |
---|---|
date | Thu, 27 Feb 2014 00:30:03 +0100 |
parents | 4c9fef516e0a |
children | 8878fba164fd |
files | Party.cpp Party.h mm7_4.cpp mm7_unsorted_subs.h |
diffstat | 4 files changed, 33 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Party.cpp Thu Feb 27 00:27:58 2014 +0100 +++ b/Party.cpp Thu Feb 27 00:30:03 2014 +0100 @@ -1153,4 +1153,35 @@ bool Party::IsPartyGood() { return _449B57_test_bit(_quest_bits, 99); +} + + + +//----- (0046A89E) -------------------------------------------------------- +int Party::_46A89E_immolation_effect(int* affected, int affectedArrSize, int effectRange) +{ + int v5; // ebx@3 + int v17; // [sp+Ch] [bp-10h]@3 + int v18; // [sp+10h] [bp-Ch]@3 + int affectedCount; // [sp+18h] [bp-4h]@1 + + affectedCount = 0; + for ( size_t i = 0; i < uNumActors; ++i ) + { + v5 = abs(pActors[i].vPosition.x - this->vPosition.x); + v17 = abs(pActors[i].vPosition.y - this->vPosition.y); + v18 = abs(pActors[i].vPosition.z - this->vPosition.z); + if ( int_get_vector_length(v5, v17, v18) <= effectRange ) + { + if ( pActors[i].uAIState != Dead && pActors[i].uAIState != Dying && pActors[i].uAIState != Removed + && pActors[i].uAIState != Disabled && pActors[i].uAIState != Summoned ) + { + affected[affectedCount] = i; + affectedCount++; + if ( affectedCount >= affectedArrSize ) + break; + } + } + } + return affectedCount; } \ No newline at end of file
--- a/Party.h Thu Feb 27 00:27:58 2014 +0100 +++ b/Party.h Thu Feb 27 00:30:03 2014 +0100 @@ -221,7 +221,7 @@ bool IsPartyEvil(); bool IsPartyGood(); - + int _46A89E_immolation_effect(int* affected, int affectedArrSize, int effectRange); int field_0; unsigned int uPartyHeight; unsigned int uDefaultPartyHeight;
--- a/mm7_4.cpp Thu Feb 27 00:27:58 2014 +0100 +++ b/mm7_4.cpp Thu Feb 27 00:30:03 2014 +0100 @@ -369,7 +369,7 @@ a1.spell_caster_pid = PID(OBJECT_Player, pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].uCaster); a1.uFacing = 0; a1.uSoundID = 0; - numberOfActorsAffected = _46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307); + numberOfActorsAffected = pParty->_46A89E_immolation_effect(actorsAffectedByImmolation, 100, 307); for ( v9 = 0; v9 < numberOfActorsAffected; ++v9 ) { v14 = actorsAffectedByImmolation[v9];
--- a/mm7_unsorted_subs.h Thu Feb 27 00:27:58 2014 +0100 +++ b/mm7_unsorted_subs.h Thu Feb 27 00:30:03 2014 +0100 @@ -223,7 +223,6 @@ void ShowPopupShopItem(); void RestAndHeal(__int64 uNumMinutes); // idb void GetHouseGoodbyeSpeech(); -int _46A89E_immolation_effect(int* affected, int affectedArrSize, int effectRange); unsigned int GetGravityStrength(); void UpdateUserInput_and_MapSpecificStuff(); void BLV_UpdateUserInputAndOther();