diff mm7_3.cpp @ 413:111f25d1cc04

AI_Stand
author Nomad
date Sat, 23 Feb 2013 16:39:32 +0200
parents 747933903b1c
children d8b3056df4e2
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Feb 23 16:02:04 2013 +0200
+++ b/mm7_3.cpp	Sat Feb 23 16:39:32 2013 +0200
@@ -17754,7 +17754,7 @@
   float v80; // [sp+98h] [bp-18h]@33
   int v81; // [sp+9Ch] [bp-14h]@100
   int v82; // [sp+A0h] [bp-10h]@45
-  unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
+  //unsigned int uActorID; // [sp+A4h] [bp-Ch]@32
   unsigned int v84; // [sp+A8h] [bp-8h]@11
   signed int a2; // [sp+ACh] [bp-4h]@83
 
@@ -17911,7 +17911,7 @@
     {
       if (actor->uAIState != Summoned)
       {
-        Actor::_403F58(i, Dying, 256, 0);
+        Actor::_403F58(i, OBJECT_Player, 256, nullptr);
         continue;
       }
       actor->uAIState = Standing;
@@ -17929,14 +17929,17 @@
 
 
   v78 = 0;
+  int actor_id = -1;
   if ( ai_arrays_size > 0 )
   {
     while ( 1 )
     {
-      uActorID = ai_near_actors_ids[v78];
-      v20 = &dword_4F6E08[uActorID];
-      v21 = &pActors[uActorID];
-      Actor::_401221(uActorID, &dword_4F6E08[uActorID], 1u);
+      actor_id = ai_near_actors_ids[v78];
+      assert(actor_id < uNumActors);
+
+      v20 = &dword_4F6E08[actor_id];
+      v21 = &pActors[actor_id];
+      Actor::_401221(actor_id, &dword_4F6E08[actor_id], 1u);
       if ( v21->pMonsterInfo.uHostilityType && !*v20 )
         v21->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
       a2 = *v20;
@@ -17949,7 +17952,7 @@
       if ( v22 == Dying || v22 == Dead || v22 == Removed || v22 == Disabled || v22 == Summoned)
         goto LABEL_254;
       if ( !v21->sCurrentHP )
-        Actor::Die(uActorID);
+        Actor::Die(actor_id);
       if ( (signed __int64)v21->pActorBuffs[3].uExpireTime <= 0 )
       {
         v84 = 0;
@@ -18017,8 +18020,8 @@
       v29 = v21->uAttributes;
       if ( !(v29 & 0x8000) )
         v21->uAttributes = v29 | 0x8000;
-      a1 = 8 * uActorID | 3;
-      v30 = Actor::GetDirectionInfo(8 * uActorID | 3, a2, &a3, 0);
+      a1 = 8 * actor_id | OBJECT_Actor;
+      v30 = Actor::GetDirectionInfo(8 * actor_id | OBJECT_Actor, a2, &a3, 0);
       v49 = v21->pMonsterInfo.uHostilityType == 0;
       memcpy(&v75, v30, sizeof(v75));
       memcpy(&pDir, &v75, sizeof(pDir));
@@ -18028,7 +18031,7 @@
           && ((v31 = v21->uAIState, v31 == 6) || !v31 || v31 == 1 || v31 == 9)
           || v21->pMonsterInfo.uMissleAttack1Type && v21->uAIState == 8 )
         {
-          v32 = uActorID;
+          v32 = actor_id;
           goto LABEL_152;
         }
       }
@@ -18036,8 +18039,8 @@
         goto LABEL_254;
       if ( v21->uAIState == 2 )
       {
-        v32 = uActorID;
-        v35 = stru_50C198.special_ability_use_check(v21, uActorID);
+        v32 = actor_id;
+        v35 = stru_50C198.special_ability_use_check(v21, actor_id);
         stru_50FE08.Add(
           a1,
           5120,
@@ -18059,11 +18062,11 @@
         v34 = v21->pMonsterInfo.uMissleAttack2Type;
         v66 = 1;
 LABEL_149:
-        v32 = uActorID;
-        Actor::_404874(uActorID, &pDir, v34, v66);
+        v32 = actor_id;
+        Actor::_404874(actor_id, &pDir, v34, v66);
         goto LABEL_152;
       }
-      v32 = uActorID;
+      v32 = actor_id;
       if ( v21->uAIState == 13 )
         break;
       if ( v21->uAIState == 18 )
@@ -18072,7 +18075,7 @@
         v60 = 3;
         v33 = v21->pMonsterInfo.uSpell2ID;
 LABEL_146:
-        Actor::_404AC7(uActorID, &pDir, v33, v60, v65);
+        Actor::_404AC7(actor_id, &pDir, v33, v60, v65);
       }
 LABEL_152:
       v36 = v75.uDistance;
@@ -18136,7 +18139,7 @@
           v67 = &pDir;
           if ( v21->pMonsterInfo.uMovementType != 5 )
             goto LABEL_181;
-          Actor::_403EB6(
+          Actor::AI_Stand(
             v32,
             a2,
             (signed __int64)((double)(signed int)v21->pMonsterInfo.uRecoveryTime * 2.133333333333333),
@@ -18252,7 +18255,7 @@
               v64 = (signed __int64)v47;
               v52 = v32;
 LABEL_247:
-              Actor::_403EB6(v52, v51, v64, v69);
+              Actor::AI_Stand(v52, v51, v64, v69);
               goto LABEL_254;
             }
             v69 = &pDir;
@@ -18321,7 +18324,7 @@
           memcpy(&v74, v57, sizeof(v74));
           memcpy(&pDir, &v74, sizeof(pDir));
           v69 = &pDir;
-          v52 = uActorID;
+          v52 = actor_id;
           v64 = (signed __int64)v58;
           v51 = 4;
           goto LABEL_247;