diff mm7_3.cpp @ 920:34ed2d5e7cfb

MagicShopDialog clean and other
author Ritor1
date Sun, 28 Apr 2013 19:11:36 +0600
parents 8cd0b155bebe
children 3696848c0413
line wrap: on
line diff
--- a/mm7_3.cpp	Sat Apr 27 09:37:22 2013 +0600
+++ b/mm7_3.cpp	Sun Apr 28 19:11:36 2013 +0600
@@ -15991,12 +15991,12 @@
 //----- (004059DB) --------------------------------------------------------
 signed int stru262_TurnBased::Start()
 {
-  stru262_TurnBased *v1; // ebx@1
+  //stru262_TurnBased *v1; // ebx@1
   unsigned int v2; // edi@1
   int v3; // esi@1
   int v4; // eax@5
   unsigned int v5; // esi@7
-  Actor *v6; // edi@7
+  Actor *pActor; // edi@7
   unsigned int v7; // eax@9
   unsigned int v8; // edx@10
   unsigned __int8 v9; // zf@14
@@ -16025,39 +16025,39 @@
   int v33; // [sp+60h] [bp-14h]@10
   int *v34; // [sp+64h] [bp-10h]@6
   int v35; // [sp+68h] [bp-Ch]@5
-  Player *v40; // [sp+6Ch] [bp-8h]@1
+  Player *pPlayer; // [sp+6Ch] [bp-8h]@1
   int v40b;
   unsigned int v37; // [sp+70h] [bp-4h]@7
 
   pTurnEngine->field_18 &= 0xFFFFFFFDu;
-  v1 = this;
+  //v1 = this;
   pEventTimer->TrackGameTime();
   pAudioPlayer->StopChannels(-1, -1);
   v2 = 0;
   pAudioPlayer->PlaySound((SoundID)(SOUND_GoldReceived|SOUND_EnteringAHouse|0x1), 0, 0, -1, 0, 0, 0, 0);
-  v40 = pParty->pPlayers;
+  pPlayer = pParty->pPlayers;
   dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
   dword_50C994 = 0;
-  v1->field_10 = 100;
-  v1->field_0 = 0;
-  v1->field_8 = 64;
-  v1->field_4 = 1;
-  v1->uActorQueueSize = 0;
+  this->field_10 = 100;
+  this->field_0 = 0;
+  this->field_8 = 64;
+  this->field_4 = 1;
+  this->uActorQueueSize = 0;
   v3 = 0;
   do
   {
-    if ( v40->CanAct() )
-    {
-      *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = PID(OBJECT_Player,v3);
-      v1->pQueue[v1->uActorQueueSize].field_C = 2;
-      v1->pQueue[v1->uActorQueueSize].uActionLength = 0;
-      pParty->pTurnBasedPlayerRecoveryTimes[v1->uActorQueueSize++] = 0;
-    }
-    ++v40;
+    if ( pPlayer->CanAct() )
+    {
+      *(&this->field_0 + 4 * (this->uActorQueueSize + 2)) = PID(OBJECT_Player,v3);
+      this->pQueue[this->uActorQueueSize].field_C = 2;
+      this->pQueue[this->uActorQueueSize].uActionLength = 0;
+      pParty->pTurnBasedPlayerRecoveryTimes[this->uActorQueueSize++] = 0;
+    }
+    ++pPlayer;
     ++v3;
   }
-  while ( v40 <=&pParty->pPlayers[3] );
-  v35 = v1->uActorQueueSize;
+  while ( pPlayer <= &pParty->pPlayers[3] );
+  v35 = this->uActorQueueSize;
   v4 = v35;
   v40b = v35;
   if ( v40b < v40b + ai_arrays_size )
@@ -16067,24 +16067,24 @@
     {
       v37 = *v34;
       v5 = v37;
-      v6 = &pActors[v37];
+      pActor = &pActors[v37];
       if ( v37 != 10 )
       {
         if ( pActors[v37].CanAct() )
         {
-          v7 = v6->uAttributes;
+          v7 = pActor->uAttributes;
           if ( v7 & 0x8000 < 0 )
           {
             v8 = ai_near_actors_targets_pid[v5];
             LOBYTE(v7) = v7 | 0x80;
-            v6->uAttributes = v7;
+            pActor->uAttributes = v7;
             v33 = PID(OBJECT_Actor,v5);
             memcpy(&v31, Actor::GetDirectionInfo(PID(OBJECT_Actor,v5), v8, &a3, 0), sizeof(v31));
             memcpy(&v30, &v31, sizeof(v30));
             Actor::AI_StandOrBored(v37, 4, 32, &v30);
-            *(&v1->field_0 + 4 * (v1->uActorQueueSize + 2)) = v33;
-            v1->pQueue[v1->uActorQueueSize].field_C = 2;
-            v1->pQueue[v1->uActorQueueSize++].uActionLength = 0;
+            *(&this->field_0 + 4 * (this->uActorQueueSize + 2)) = v33;
+            this->pQueue[this->uActorQueueSize].field_C = 2;
+            this->pQueue[this->uActorQueueSize++].uActionLength = 0;
           }
         }
         v4 = v35;
@@ -16095,14 +16095,14 @@
     while ( v40b < v4 + ai_arrays_size );
     v2 = 0;
   }
-  v11 = __OFSUB__(v1->uActorQueueSize, v2);
-  v9 = v1->uActorQueueSize == v2;
-  v10 = ((v1->uActorQueueSize - v2) & 0x80000000u) != 0;
+  v11 = __OFSUB__(this->uActorQueueSize, v2);
+  v9 = this->uActorQueueSize == v2;
+  v10 = ((this->uActorQueueSize - v2) & 0x80000000u) != 0;
   v37 = v2;
   v40b = v2;
   if ( !((unsigned __int8)(v10 ^ v11) | v9) )
   {
-    v12 = (char *)&v1->pQueue[0].field_4;
+    v12 = (char *)&this->pQueue[0].field_4;
     while ( 1 )
     {
       v13 = PID_TYPE(*((int *)v12 - 1));
@@ -16113,7 +16113,6 @@
       {
         v33 = v14;
         v16 = (signed __int64)((double)v14 * 0.46875);
-LABEL_20:
         *(int *)v12 = v16;
         goto LABEL_26;
       }
@@ -16122,7 +16121,7 @@
 LABEL_26:
       ++v40b;
       v12 += 16;
-      if ( v40b >= v1->uActorQueueSize )
+      if ( v40b >= this->uActorQueueSize )
         goto LABEL_27;
     }
     if ( v13 != 3 )
@@ -16139,7 +16138,8 @@
     LODWORD(v16) = SHIDWORD(v16) < 66;
     LOBYTE(v16) = SHIDWORD(v16) >= 66;
     LODWORD(v16) = 2 * v16 + 3;
-    goto LABEL_20;
+    *(int *)v12 = v16;
+    goto LABEL_26;
   }
 LABEL_27:
   v18 = 0;
@@ -16148,8 +16148,7 @@
     do
     {
       __debugbreak();
-      *(&v31.uDistance + v18) = pParty->pPlayers[*(&v1->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(
-                                  v2);
+      *(&v31.uDistance + v18) = pParty->pPlayers[*(&this->field_0 + 4 * (*(&a3.uDistance + v18) + 2)) >> 3].GetAttackRecoveryTime(v2);
       ++v18;
     }
     while ( (signed int)v18 < (signed int)v37 );
@@ -16197,11 +16196,11 @@
           v28 = *(&a3.uDistance + v2++);
           v11 = __OFSUB__(v2, v37);
           v10 = ((v2 - v37) & 0x80000000u) != 0;
-          v1->pQueue[v28].field_4 = v27;
+          this->pQueue[v28].field_4 = v27;
         }
         while ( v10 ^ v11 );
       }
     }
   }
-  return v1->_404544();
-}
+  return this->_404544();
+}