diff mm7_3.cpp @ 846:39503542470c

UpdateActors_ODM cleaning 2
author zipi
date Fri, 29 Mar 2013 16:32:02 +0000
parents 8f135b689262
children ceef50611567 7ada14f991f5
line wrap: on
line diff
--- a/mm7_3.cpp	Fri Mar 29 16:13:32 2013 +0000
+++ b/mm7_3.cpp	Fri Mar 29 16:32:02 2013 +0000
@@ -863,12 +863,12 @@
 {
   Actor *v0; // esi@2
   AIState uAIState; // ax@2
-  unsigned int v2; // ecx@6
+  //unsigned int v2; // ecx@6
   int v3; // ebx@6
   //int v4; // eax@8
   int v5; // eax@10
   int v6; // ecx@10
-  signed int v7; // ebx@10
+  //signed int v7; // ebx@10
   signed int v8; // ebx@17
   //unsigned __int8 v9; // zf@17
   unsigned __int8 v10; // sf@17
@@ -878,7 +878,7 @@
   int v14; // eax@30
   unsigned __int64 v15; // qax@30
   int v16; // eax@33
-  int v17; // edi@34
+  //int v17; // edi@34
   int v18; // edx@42
   int v19; // ecx@42
   __int16 v20; // ax@42
@@ -929,7 +929,7 @@
   int v65; // [sp+20h] [bp-30h]@2
   int v66; // [sp+24h] [bp-2Ch]@2
   bool v67; // [sp+28h] [bp-28h]@10
-  unsigned int v68; // [sp+2Ch] [bp-24h]@10
+  //unsigned int v68; // [sp+2Ch] [bp-24h]@10
   unsigned int v69; // [sp+30h] [bp-20h]@6
   unsigned int v70; // [sp+34h] [bp-1Ch]@10
   int v71; // [sp+38h] [bp-18h]@62
@@ -950,10 +950,9 @@
 	{
 		continue;
 	}
-    v2 = v0->pMonsterInfo.uID;
     v3 = 0;
     v69 = 0;
-    if ( MonsterStats::BelongsToSupertype(v2, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
+    if ( MonsterStats::BelongsToSupertype(v0->pMonsterInfo.uID, MONSTER_SUPERTYPE_WATER_ELEMENTAL) )
       v3 = 1;
     v0->uSectorID = 0;
     uIsFlying = v0->pMonsterInfo.uFlying;
@@ -969,8 +968,6 @@
            (int *)&v69,
            v3);
     v6 = v0->vPosition.z;
-    v7 = v5;
-    v68 = v5;
     uIsAboveFloor = 0;
     v67 = v69 == 0;
     if ( v6 > v5 + 1 )
@@ -1013,7 +1010,7 @@
         v73 = v15 >> 16;
         v0->vVelocity.z = WORD1(v15);
       }
-      v7 = v68;
+      //v7 = v68;
     }
     else
     {
@@ -1032,20 +1029,20 @@
         v0->vVelocity.z = v73;
       }
     }
-    if ( v0->vPosition.z < v7 )
+    if ( v0->vPosition.z < v5 )
     {
       v16 = uIsFlying;
-      v0->vPosition.z = v7;
+      v0->vPosition.z = v5;
       v0->vVelocity.z = v16 != 0 ? 0x14 : 0;
     }
-    v17 = 0;
+    //v17 = 0;
     if ( !uIsAboveFloor || uIsFlying )
     {
       if ( v70 && !uIsAboveFloor && v67 )
       {
         v18 = v0->vPosition.y;
         v19 = v0->vPosition.x;
-        v0->vPosition.z = v7;
+        v0->vPosition.z = v5;
         ODM_GetTerrainNormalAt(v19, v18, &v62);
         v20 = GetGravityStrength();
         v21 = v62.y;
@@ -1061,14 +1058,14 @@
         v0->vVelocity.y += v24;
         v72b = (unsigned __int64)(v73 * (signed __int64)v72b) >> 16;
         v0->vVelocity.z += v72b;
-        v17 = 0;
+        //v17 = 0;
       }
     }
     else
     {
       v0->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength();
     }
-    if ( pParty->armageddon_timer != v17 && v0->CanAct() )
+    if ( pParty->armageddon_timer != 0 && v0->CanAct() )
     {
       v0->vVelocity.x += rand() % 100 - 50;
       v0->vVelocity.y += rand() % 100 - 50;
@@ -1078,10 +1075,10 @@
       v0->uYawAngle += v25 % 32 - 16;
       v0->UpdateAnimation();
     }
-    if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == v17 )
-    {
-      v0->vVelocity.y = v17;
-      v0->vVelocity.x = v17;
+    if ( v0->vVelocity.x * v0->vVelocity.x + v0->vVelocity.y * v0->vVelocity.y < 400 && v70 == 0 )
+    {
+      v0->vVelocity.y = 0;
+      v0->vVelocity.x = 0;
     }
     stru_721530.field_0 = 1;
     if ( !uIsFlying )
@@ -1093,8 +1090,8 @@
     stru_721530.field_8 = v26;
     stru_721530.prolly_normal_d = v26;
     stru_721530.field_C = v27;
-    stru_721530.field_70 = v17;
-    v69 = v17;
+    stru_721530.field_70 = 0;
+    v69 = 0;
     while ( 1 )
     {
       stru_721530.field_34.x = v0->vPosition.x;
@@ -1148,7 +1145,7 @@
             if ( v64 )
               v61 = v36 + 30;
             else
-              v61 = v68 + 60;
+              v61 = v5 + 60;
             sub_42F960_create_object(v0->vPosition.x, v0->vPosition.y, v61);
             v0->uAIState = Removed;
             return;
@@ -1305,14 +1302,9 @@
         break;
       v26 = stru_721530.prolly_normal_d;
     }
-    v69 = WorldPosToGridCellX(v66);
-    v55 = WorldPosToGridCellZ(v65);
-    v57 = v0->vPosition.x;
-    v68 = WorldPosToGridCellX(v57);
-    v70 = WorldPosToGridCellZ(v0->vPosition.y) - 1;
-    v58 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v69, v56) >> 1) & 1;
-    v59 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(v68, v70) >> 1) & 1;
-    if ( WorldPosToGridCellX(v66) == WorldPosToGridCellX(v57) 
+    v58 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(WorldPosToGridCellX(v66), WorldPosToGridCellZ(v65) - 1) >> 1) & 1;
+    v59 = ((unsigned int)~pOutdoor->ActuallyGetSomeOtherTileInfo(WorldPosToGridCellX(v0->vPosition.x), WorldPosToGridCellZ(v0->vPosition.y) - 1) >> 1) & 1;
+    if ( WorldPosToGridCellX(v66) == WorldPosToGridCellX(v0->vPosition.x) 
 		&& WorldPosToGridCellZ(v65) == WorldPosToGridCellZ(v0->vPosition.y)
 		&& v58 
 		|| v67 != 0 )