diff mm7_4.cpp @ 1336:3358b59b8fe8

m
author Ritor1
date Thu, 04 Jul 2013 09:21:40 +0600
parents ae435824ac4d
children c6695ebd8fe6
line wrap: on
line diff
--- a/mm7_4.cpp	Wed Jul 03 09:37:49 2013 +0600
+++ b/mm7_4.cpp	Thu Jul 04 09:21:40 2013 +0600
@@ -6365,161 +6365,153 @@
 //----- (00405E14) --------------------------------------------------------
 void stru262_TurnBased::_405E14()
 {
-  stru262_TurnBased *v1; // esi@1
-  int v2; // ecx@1
-  SpellBuff *v3; // edi@2
-  Actor *v4; // ebx@3
-  signed int v5; // edx@20
+  //stru262_TurnBased *v1; // esi@1
+  //int v2; // ecx@1
+  //SpellBuff *v3; // edi@2
+  //Actor *v4; // ebx@3
+  //signed int v5; // edx@20
   AIDirection *v6; // esi@21
-  int v7; // eax@21
-  int v8; // eax@21
+  //int v7; // eax@21
+  //int v8; // eax@21
   int v9; // eax@22
   int v10; // eax@23
-  int v11; // eax@37
-  int v12; // eax@44
+  //int v11; // eax@37
+  //int v12; // eax@44
   AIDirection a3; // [sp+4h] [bp-68h]@21
   AIDirection v14; // [sp+20h] [bp-4Ch]@21
   AIDirection v15; // [sp+3Ch] [bp-30h]@21
-  Actor *v16; // [sp+58h] [bp-14h]@2
+  //Actor *v16; // [sp+58h] [bp-14h]@2
   int v17; // [sp+5Ch] [bp-10h]@6
-  stru262_TurnBased *v18; // [sp+60h] [bp-Ch]@1
+  //stru262_TurnBased *v18; // [sp+60h] [bp-Ch]@1
   int v19; // [sp+64h] [bp-8h]@8
   unsigned int v20; // [sp+68h] [bp-4h]@1
 
-  v1 = this;
-  v2 = 0;
-  v18 = v1;
-  v20 = 0;
+  //v1 = this;
+  //v2 = 0;
+  //v18 = this;
+  
   if ( (signed int)uNumActors > 0 )
   {
     //v3 = pActors;//[0].pActorBuffs;
-    v16 = pActors.data();//[0].pActorBuffs;
-	v3 = v16->pActorBuffs;
-    do
+    //v16 = pActors.data();//[0].pActorBuffs;
+    //v3 = v16->pActorBuffs;
+
+    for ( v20 = 0; v20 < uNumActors; ++v20 )
     {
-      v4 = v16;
-	  if ( SHIDWORD(v3[3].uExpireTime) < v2 || SHIDWORD(v3[3].uExpireTime) <= v2 && LODWORD(v3[3].uExpireTime) <= v2 )
-        v17 = v2;
+      if ( pActors[v20].pActorBuffs[3].uExpireTime <= 0 )
+        v17 = 0;
       else
         v17 = 1;
-      v19 = v2;
-      do
+      
+      for ( v19 = 0; v19 < 22; ++v19 )
       {
         if ( v19 != 10 )
-        {
-          v3->_4585CA(pParty->uTimePlayed);
-          v2 = 0;
-        }
-        ++v19;
-        ++v3;
+          pActors[v20].pActorBuffs[v19]._4585CA(pParty->uTimePlayed);
       }
-      while ( v19 < 22 );
-      if ( v17 != v2
-        && SHIDWORD(v4->pActorBuffs[3].uExpireTime) <= v2
-        && (SHIDWORD(v4->pActorBuffs[3].uExpireTime) < v2 || LODWORD(v4->pActorBuffs[3].uExpireTime) <= v2) )
-        v4->uActorHeight = pMonsterList->pMonsters[v4->pMonsterInfo.uID - 1].uMonsterHeight;
-      if ( !(v4->uAttributes & 0x80) )
+      if ( v17 && pActors[v20].pActorBuffs[3].uExpireTime <= 0 )
+        pActors[v20].uActorHeight = pMonsterList->pMonsters[pActors[v20].pMonsterInfo.uID - 1].uMonsterHeight;
+      if ( !(pActors[v20].uAttributes & 0x80) )
       {
-        if ( !v4->pActorBuffs[5].uExpireTime )
+        if ( !pActors[v20].pActorBuffs[5].uExpireTime )
         {
-          if ( !v4->pActorBuffs[6].uExpireTime )
+          if ( !pActors[v20].pActorBuffs[6].uExpireTime )
           {
-            v5 = v4->uCurrentActionLength;
-            v4->uCurrentActionTime += pMiscTimer->uTimeElapsed;
-            if ( (signed int)v4->uCurrentActionTime >= v5 )
+            //v5 = v16->uCurrentActionLength;
+            pActors[v20].uCurrentActionTime += pMiscTimer->uTimeElapsed;
+            if ( (signed int)pActors[v20].uCurrentActionTime >= pActors[v20].uCurrentActionLength )
             {
               v17 = ai_near_actors_targets_pid[v20];
-              v6 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v20), v17, &a3, v2);
-              v7 = v4->uAIState;
-              memcpy(&v15, v6, sizeof(v15));
-              v8 = v7 - 4;
-              memcpy(&v14, &v15, sizeof(v14));
-              if ( v8 )
+              v6 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v20), v17, &a3, 0);
+              //v7 = v16->uAIState;
+              memcpy(&v15, v6, sizeof(AIDirection));
+              //v8 = pActors[v20].uAIState - 4;
+              memcpy(&v14, &v15, sizeof(AIDirection));
+              if ( pActors[v20].uAIState > Dying )
               {
-                v9 = v8 - 1;
-                if ( v9 )
-                {
-                  v10 = v9 - 6;
-                  if ( v10 )
-                  {
-                    if ( v10 != 8 )
+                //v9 = v8 - 1;
+                //if ( v9 )
+                //{
+                  //v10 = v9 - 6;
+                  //if ( v10 )
+                  //{
+                    if ( pActors[v20].uAIState != Disabled )
                       Actor::AI_StandOrBored(v20, v17, 32, &v14);
-                  }
-                }
+                  //}
+                //}
               }
               else
               {
-                v4->uCurrentActionTime = 0;
-                v4->uCurrentActionLength = 0;
-                v4->uAIState = Dead;
-                v4->UpdateAnimation();
+                pActors[v20].uCurrentActionTime = 0;
+                pActors[v20].uCurrentActionLength = 0;
+                pActors[v20].uAIState = Dead;
+                pActors[v20].UpdateAnimation();
               }
-              v1 = v18;
-              v2 = 0;
+              //this = v18;
+              //v2 = 0;
             }
           }
         }
       }
-      ++v20;
-	  v3 = v16[1].pActorBuffs;
-      ++v16;
+      //++v20;
+	  //v3 = v16[1].pActorBuffs;
+      //++v16;
     }
-    while ( (signed int)v20 < (signed int)uNumActors );
+    //while ( (signed int)v20 < (signed int)uNumActors );
   }
-  if ( v1->field_4 == 1 )
+  if ( this->field_4 == 1 )
   {
-    v12 = v1->field_8;
-    if ( v12 == 64 )
+    //v12 = this->field_8;
+    if ( this->field_8 == 64 )
     {
-      v1->_406A63();
+      this->_406A63();
     }
     else
     {
-      if ( v12 > v2 )
+      if ( this->field_8 > 0 )
       {
-        v1->_406B9F();
+        this->_406B9F();
       }
       else
       {
-        v1->_406AFE();
-        v1->field_10 = 100;
+        this->_406AFE();
+        this->field_10 = 100;
       }
     }
-    v1->field_8 -= pEventTimer->uTimeElapsed;
+    this->field_8 -= pEventTimer->uTimeElapsed;
     return;
   }
-  if ( v1->field_4 == 2 )
+  if ( this->field_4 == 2 )
   {
-    if ( !(v1->field_18 & 1) )
+    if ( !(this->field_18 & 1) )
     {
-      v11 = v1->field_10;
-      if ( v11 == 100 )
+      //v11 = this->field_10;
+      if ( this->field_10 == 100 )
       {
-        v1->StartTurn();
-LABEL_39:
-        v1->_40652A();
+        this->StartTurn();
+        this->_40652A();
         return;
       }
-      if ( v11 > v2 || v1->pQueue[0].field_4 <= v2 )
+      if ( this->field_10 > 0 || this->pQueue[0].field_4 <= 0 )
       {
-        v1->_4065B0();
-        goto LABEL_39;
+        this->_4065B0();
+        this->_40652A();
+        return;
       }
     }
-    v1->NextTurn();
+    this->NextTurn();
     return;
   }
-  if ( v1->field_4 == 3 )
+  if ( this->field_4 == 3 )
   {
-    if ( v1->uActionPointsLeft <= v2 || v1->field_18 & 8 )
+    if ( this->uActionPointsLeft <= 0 || this->field_18 & 8 )
     {
-      v1->field_18 &= 0xFFFFFFF7u;
-      v1->field_4 = 1;
-      v1->field_8 = 64;
+      this->field_18 &= 0xFFFFFFF7u;
+      this->field_4 = 1;
+      this->field_8 = 64;
     }
     else
     {
-      v1->_406FA8();
+      this->_406FA8();
     }
   }
 }
\ No newline at end of file