Mercurial > mm7
diff mm7_5.cpp @ 1336:3358b59b8fe8
m
author | Ritor1 |
---|---|
date | Thu, 04 Jul 2013 09:21:40 +0600 |
parents | e70fe5d77928 |
children | c6695ebd8fe6 |
line wrap: on
line diff
--- a/mm7_5.cpp Wed Jul 03 09:37:49 2013 +0600 +++ b/mm7_5.cpp Thu Jul 04 09:21:40 2013 +0600 @@ -5583,44 +5583,43 @@ //----- (00406A63) -------------------------------------------------------- void stru262_TurnBased::_406A63() { - stru262_TurnBased *v1; // ebx@1 - int v2; // esi@1 - unsigned __int8 v3; // zf@1 - unsigned __int8 v4; // sf@1 - signed int v5; // ecx@4 + //stru262_TurnBased *v1; // ebx@1 + //int v2; // esi@1 + //unsigned __int8 v3; // zf@1 + //unsigned __int8 v4; // sf@1 + //signed int v5; // ecx@4 AIDirection a3; // [sp+8h] [bp-44h]@5 AIDirection v7; // [sp+24h] [bp-28h]@5 unsigned int v8; // [sp+40h] [bp-Ch]@5 signed int a2; // [sp+44h] [bp-8h]@1 - TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2 - - v1 = this; - v2 = 0; + //TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2 + + //v1 = this; + //v2 = 0; this->field_8 = 64; dword_50C994 = 0; uActiveCharacter = 0; - v3 = this->uActorQueueSize == 0; - v4 = this->uActorQueueSize < 0; - a2 = 0; - if ( !(v4 | v3) ) + //v3 = this->uActorQueueSize == 0; + //v4 = this->uActorQueueSize < 0; + + if ( this->uActorQueueSize ) { - v10 = this->pQueue; - while ( 1 ) + //v10 = this->pQueue; + + for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 ) { - v5 = v10->uPackedID; - if (PID_TYPE(v10->uPackedID) == OBJECT_Actor) + //v5 = this->pQueue[a2].uPackedID; + if (PID_TYPE(this->pQueue[a2].uPackedID) == OBJECT_Actor) { - v8 = ai_near_actors_targets_pid[PID_ID(v5)]; - memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7)); - if ( !v1->_406D10(a2) ) - Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 0x20u, &v7); + v8 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)]; + memcpy(&v7, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v8, &a3, 0), sizeof(v7)); + if ( !this->_406D10(a2) ) + Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v8, 0x20u, &v7);//actors move } - ++a2; - ++v10; - if ( a2 >= v1->uActorQueueSize ) - break; - v2 = 0; + //++v10; + //v2 = 0; } + } } // 50C994: using guessed type int dword_50C994; @@ -5675,79 +5674,58 @@ int stru262_TurnBased::_406B9F() { signed int result; // eax@1 - unsigned __int8 v2; // zf@1 - unsigned __int8 v3; // sf@1 - int v4; // esi@4 - unsigned int v5; // esi@5 - Actor *v6; // ebx@5 - unsigned __int16 v7; // cx@15 + Actor *pCurrentActor; // ebx@5 AIDirection a3; // [sp+0h] [bp-50h]@15 AIDirection v9; // [sp+1Ch] [bp-34h]@15 - signed int a1; // [sp+38h] [bp-18h]@4 - stru262_TurnBased *thisa; // [sp+3Ch] [bp-14h]@1 unsigned int v12; // [sp+40h] [bp-10h]@5 unsigned int v13; // [sp+44h] [bp-Ch]@8 - TurnBased_QueueElem *v14; // [sp+48h] [bp-8h]@2 signed int a2; // [sp+4Ch] [bp-4h]@1 result = 0; - thisa = this; - v2 = this->uActorQueueSize == 0; - v3 = this->uActorQueueSize < 0; - a2 = 0; - if ( !(v3 | v2) ) + if ( this->uActorQueueSize ) { - v14 = this->pQueue; - while ( 1 ) + + for ( a2 = 0; a2 < this->uActorQueueSize; ++a2 ) { - v4 = v14->uPackedID; - a1 = v14->uPackedID; - if (PID_TYPE(a1) != OBJECT_Player) + if (PID_TYPE(this->pQueue[a2].uPackedID) != OBJECT_Player) { - v5 = PID_ID(v4); - v12 = v5; - v6 = &pActors[v5]; - if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result - || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result ) - v13 = result; + pCurrentActor = &pActors[PID_ID(this->pQueue[a2].uPackedID)]; + if ( pCurrentActor->pActorBuffs[5].uExpireTime <= 0 ) + v13 = 0; else v13 = 1; - if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result - && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) ) - result = 1; - if ( !(v13 != 0 || result || v6->uAIState == 5 || v6->uAIState == 11 || v6->uAIState == 19) ) + if ( pCurrentActor->pActorBuffs[6].uExpireTime >= 0 ) + v12 = 1; + if ( !(v13 != 0 || v12 || pCurrentActor->uAIState == Dead || pCurrentActor->uAIState == Removed || pCurrentActor->uAIState == Disabled) ) { - v13 = ai_near_actors_targets_pid[v5]; - memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9)); - v7 = v6->uAIState; - if ( v7 == 6 || v7 == 1 ) + v13 = ai_near_actors_targets_pid[PID_ID(this->pQueue[a2].uPackedID)]; + memcpy(&v9, Actor::GetDirectionInfo(this->pQueue[a2].uPackedID, v13, &a3, 0), sizeof(v9)); + if ( pCurrentActor->uAIState == Pursuing || pCurrentActor->uAIState == Tethered ) { if ( (double)(signed int)v9.uDistance < 307.2 ) - goto LABEL_26; - } - v6->uCurrentActionTime += pEventTimer->uTimeElapsed; - if ( (signed int)v6->uCurrentActionTime > v6->uCurrentActionLength ) - { - if ( v7 == 4 ) { - v6->uCurrentActionTime = 0; - v6->uCurrentActionLength = 0; - v6->uAIState = Dead; - v6->UpdateAnimation(); + Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9); + continue; } - if ( !thisa->_406D10(a2) ) -LABEL_26: - Actor::AI_Stand(v12, v13, 0x20u, &v9); + } + pCurrentActor->uCurrentActionTime += pEventTimer->uTimeElapsed; + if ( (signed int)pCurrentActor->uCurrentActionTime > pCurrentActor->uCurrentActionLength ) + { + if ( pCurrentActor->uAIState == Dying ) + { + pCurrentActor->uCurrentActionTime = 0; + pCurrentActor->uCurrentActionLength = 0; + pCurrentActor->uAIState = Dead; + pCurrentActor->UpdateAnimation(); + } + if ( !this->_406D10(a2) ) + Actor::AI_Stand(PID_ID(this->pQueue[a2].uPackedID), v13, 0x20u, &v9); } } } - ++a2; - result = (signed int)thisa; - ++v14; - if ( a2 >= thisa->uActorQueueSize ) - break; result = 0; } + } return result; } @@ -5785,7 +5763,7 @@ unsigned int uActorID; // [sp+50h] [bp-4h]@2 unsigned int a2a; // [sp+5Ch] [bp+8h]@7 - __debugbreak();//срабатывает при пошаговом режиме после пяти шагов + //__debugbreak();//срабатывает при пошаговом режиме после пяти шагов v2 = *(&this->field_0 + 4 * (a2 + 2)); if (PID_TYPE(v2) == OBJECT_Player) return 0;