diff mm7_4.cpp @ 112:909822c91d47

pointer fixes
author zipi
date Sat, 09 Feb 2013 18:46:06 +0000
parents 8a10c9780e17
children 3471df3713e2 c70fea5013aa
line wrap: on
line diff
--- a/mm7_4.cpp	Sun Feb 10 00:17:23 2013 +0600
+++ b/mm7_4.cpp	Sat Feb 09 18:46:06 2013 +0000
@@ -79,7 +79,7 @@
   unsigned int v6; // ecx@3
   unsigned int v7; // edx@6
   unsigned int v8; // edx@8
-  char *v9; // edi@13
+  Actor *v9; // edi@13
   int v10; // ebx@14
   int v11; // eax@14
   int v12; // ebx@14
@@ -153,12 +153,12 @@
       v37 = 0;
       if ( (signed int)uNumActors > 0 )
       {
-        v9 = (char *)&pActors[0].vPosition.y;
+        v9 = pActors;//[0].vPosition.y;
         do
         {
-          v10 = abs(v33 - *((short *)v9 - 1));
-          v29 = abs(v32 - *(short *)v9);
-          v26 = abs(v35 - *((short *)v9 + 1));
+		  v10 = abs(v33 - v9->vPosition.x);
+          v29 = abs(v32 - v9->vPosition.y);
+          v26 = abs(v35 - v9->vPosition.z);
           v11 = v10;
           v12 = v29;
           v13 = v26;
@@ -183,7 +183,7 @@
           if ( (signed int)(((unsigned int)(11 * v12) >> 5) + (v13 >> 2) + v11) < v31 )
             EventProcessor(v1->field_16_event_id, 0, 1);
           ++v37;
-          v9 += 836;
+          ++v9;
         }
         while ( v37 < (signed int)uNumActors );
       }
@@ -3399,9 +3399,9 @@
   int result; // eax@1
   int v4; // eax@2
   int v5; // edi@5
-  char *v6; // ecx@5
+  int *v6; // ecx@5
   char v7; // sf@5
-  char *v8; // ecx@10
+  int *v8; // ecx@10
   int v9; // edi@15
   signed int v10; // eax@15
   __int16 *v11; // edx@16
@@ -3462,12 +3462,12 @@
         {
           v5 = v4 * pParty->pPartyBuffs[7].uPower;
           __debugbreak();
-          v6 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
-          v7 = *(int *)v6 - v5 < 0;
-          *(int *)v6 -= v5;
+		  v6 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[7].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[7].uCaster + 2000];
+          v7 = *v6 < v5;
+          *v6 -= v5;
           if ( v7 )
           {
-            *(int *)v6 = 0;
+            *v6 = 0;
             pParty->uFlags &= 0xFFFFFFBFu;
             pParty->bFlying = 0;
             v51 = 1;
@@ -3482,12 +3482,12 @@
         if ( !(pParty->pPartyBuffs[18].uFlags & 1) )
         {
           __debugbreak();
-          v8 = &stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
-          v7 = *(int *)v8 - v4 < 0;
-          *(int *)v8 -= v4;
+          v8 = (int *)&pParty->pPlayers[pParty->pPartyBuffs[18].uCaster].pConditions[0];//&stru_AA1058[4].pSounds[6972 * pParty->pPartyBuffs[18].uCaster + 2000];
+          v7 = *v8 < v4;
+          *v8 -= v4;
           if ( v7 )
           {
-            *(int *)v8 = 0;
+            *v8 = 0;
             LOBYTE(pParty->uFlags) &= 0x7Fu;
             v51 = 1;
           }
@@ -9214,7 +9214,7 @@
   signed __int64 v3; // ST1C_8@1
   unsigned __int64 v4; // qax@1
   unsigned int v5; // ebx@1
-  void *v6; // ebx@1
+  Player *v6; // ebx@1
 
   pParty->pHirelings[0].bHasUsedTheAbility = 0;
   pParty->pHirelings[1].bHasUsedTheAbility = 0;
@@ -9233,14 +9233,14 @@
   pParty->uCurrentYear = v5 / 0xC + 1168;
   pParty->RestAndHeal();
   dword_507B94 = 1;
-  v6 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay;
+  v6 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
   do
   {
-    *((short *)v6 - 258) = 0;
-    memset(v6, 0, 4u);
-    v6 = (char *)v6 + 6972;
-  }
-  while ( (signed int)v6 < (signed int)&pParty->field_871C[694] );
+	v6->uTimeToRecovery = 0;
+	memset(&v6->uTimeToRecovery, 0, 4u);
+    ++v6;
+  }
+  while ( v6 <= &pParty->pPlayers[3] );
   pParty->_4909F4();
 }
 // 507B94: using guessed type int dword_507B94;
@@ -15092,7 +15092,7 @@
   unsigned int v10; // esi@16
   int v11; // ecx@17
   unsigned int v12; // kr00_4@25
-  void *v13; // esi@25
+  Player *v13; // esi@25
   int v14; // eax@25
   Player *v15; // esi@27
   signed int v16; // eax@32
@@ -15189,17 +15189,17 @@
       v25 = (HOUSE_TYPE)187;
       v12 = LODWORD(pParty->uTimePlayed);
       LODWORD(pParty->uTimePlayed) += 0x7620000u;
-      v13 = &pParty->pPlayers[0].uNumDivineInterventionCastsThisDay;
+      v13 = pParty->pPlayers;//[0].uNumDivineInterventionCastsThisDay;
       v14 = LOBYTE(pAnimatedRooms[(signed __int16)p2DEvents[186].uAnimationID].field_C);
       pParty->uTimePlayed = __PAIR__(HIDWORD(pParty->uTimePlayed), v12) + 0x7620000;
       dword_F8B198 = v14;
       do
       {
-        *((short *)v13 - 258) = 0;
-        memset(v13, 0, 4u);
-        v13 = (char *)v13 + 6972;
-      }
-      while ( (signed int)v13 < (signed int)&pParty->field_871C[694] );
+		v13->uTimeToRecovery = 0;
+		memset(&v13->uTimeToRecovery, 0, 4u);
+        ++v13;
+      }
+      while ( v13 <= &pParty->pPlayers[3] );
       ++pParty->uNumPrisonTerms;
       pParty->uFine = 0;
       v15 = pParty->pPlayers;
@@ -15208,7 +15208,7 @@
         v15->SetVariable(VAR_Award, 87);
         ++v15;
       }
-      while ( (signed int)v15 < (signed int)pParty->pHirelings );
+      while ( v15 <= &pParty->pPlayers[3] );
       v10 = v25;
     }
     ++pIcons_LOD->uTexturePacksCount;