changeset 1337:c6695ebd8fe6

Слияние
author Ritor1
date Thu, 04 Jul 2013 09:21:57 +0600
parents 3358b59b8fe8 (diff) f0be1fecd642 (current diff)
children 9749edd941c6
files mm7_4.cpp mm7_5.cpp
diffstat 3 files changed, 248 insertions(+), 302 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Wed Jul 03 23:21:29 2013 +0400
+++ b/Actor.cpp	Thu Jul 04 09:21:57 2013 +0600
@@ -1618,243 +1618,198 @@
 AIDirection *__fastcall Actor::GetDirectionInfo(unsigned int uObj1ID, unsigned int uObj2ID, AIDirection *pOut, int a4)
 {
   signed int v4; // eax@1
-  unsigned int v5; // ecx@1
-  unsigned int v6; // ebx@1
+  signed int v5; // ecx@1
+  //unsigned int v6; // ebx@1
   int v7; // ecx@2
   int v8; // ecx@3
   int v9; // ecx@4
-  BLVFace *v10; // eax@8
-  unsigned int v11; // ecx@8
-  signed int v12; // eax@9
-  int v13; // ecx@9
-  int v14; // eax@9
+  //BLVFace *v10; // eax@8
+  //unsigned int v11; // ecx@8
+  //signed int v12; // eax@9
+  //int v13; // ecx@9
+  //int v14; // eax@9
   int v15; // eax@11
   int v16; // eax@12
   int v17; // eax@13
   int v18; // edx@15
-  signed int v19; // eax@25
-  signed int v20; // eax@28
-  int v21; // ebx@28
-  signed int v22; // eax@28
-  BLVFace *v23; // eax@35
-  int v24; // edx@35
-  unsigned int v25; // ecx@35
-  signed int v26; // eax@36
-  int v27; // ecx@36
-  int v28; // eax@36
-  int v29; // eax@37
-  signed int v30; // eax@42
+  //signed int v19; // eax@25
+  //signed int v20; // eax@28
+  //int v21; // ebx@28
+  //signed int v22; // eax@28
+  //BLVFace *v23; // eax@35
+  //int v24; // edx@35
+  //unsigned int v25; // ecx@35
+  //signed int v26; // eax@36
+  //int v27; // ecx@36
+  //int v28; // eax@36
+  //int v29; // eax@37
+  //signed int v30; // eax@42
   double v31; // st7@45
   double v32; // st6@45
   double v33; // st7@45
   AIDirection *result; // eax@48
-  int v35; // [sp-18h] [bp-64h]@17
-  int v36; // [sp-14h] [bp-60h]@17
+  //int v35; // [sp-18h] [bp-64h]@17
+  //int v36; // [sp-14h] [bp-60h]@17
   Vec3_int_ v37; // [sp-10h] [bp-5Ch]@15
-  int *v38; // [sp-4h] [bp-50h]@15
-  int *v39; // [sp+0h] [bp-4Ch]@15
-  int *v40; // [sp+4h] [bp-48h]@15
+  //int *v38; // [sp-4h] [bp-50h]@15
+  //int *v39; // [sp+0h] [bp-4Ch]@15
+  //int *v40; // [sp+4h] [bp-48h]@15
   AIDirection v41; // [sp+14h] [bp-38h]@46
   float v42; // [sp+30h] [bp-1Ch]@23
   float v43; // [sp+34h] [bp-18h]@45
-  float v44; // [sp+38h] [bp-14h]@33
-  float v45; // [sp+3Ch] [bp-10h]@33
+  float outy2; // [sp+38h] [bp-14h]@33
+  float outx2; // [sp+3Ch] [bp-10h]@33
   int outz; // [sp+40h] [bp-Ch]@6
   int outy; // [sp+44h] [bp-8h]@6
   int outx; // [sp+48h] [bp-4h]@6
   float a4a; // [sp+58h] [bp+Ch]@45
 
   v4 = PID_ID(uObj1ID);
-  v5 = PID_TYPE(uObj1ID);
-  v6 = uObj2ID;
-  switch(v5)
+  //v6 = uObj2ID;
+  v5 = PID_ID(uObj2ID);
+  switch( PID_TYPE(uObj1ID) )
   {
-	case OBJECT_Item:
-		{
-		v19 = v4;
-		outx = pSpriteObjects[v19].vPosition.x;
-		v13 = pSpriteObjects[v19].vPosition.y;
-		v14 = pSpriteObjects[v19].vPosition.z;
-		outy = v13;
-		outz = v14;
-		break;
-	    }
-	case OBJECT_Actor:
-		{
-		outx = pActors[v4].vPosition.x;
-		outy = pActors[v4].vPosition.y;
-		LODWORD(v42) = pActors[v4].uActorHeight;
-		v11 = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)SLODWORD(v42) * -0.75);
-		outz = v11;
-		break;
-		}
-	case OBJECT_Player:
-		{
-		if ( !v4 )
-		{
-			outx = pParty->vPosition.x;
-			outy = pParty->vPosition.y;
-			v14 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			outz = v14;
-			break;;
-		}
-		if ( v4 == 4 )
-		{
-			v40 = &outz;
-			v39 = &outy;
-			v38 = &outx;
-			v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
-			v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			*(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
-			v36 = 0;
-			v35 = 24;
-			Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
-			break;
-		}
-		if ( v4 == 3 )
-		{
-			v40 = &outz;
-			v39 = &outy;
-			v38 = &outx;
-			v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
-			v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			*(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
-			v36 = 0;
-			v35 = 8;
-			Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
-			break;
-		}
-		if ( v4 == 2 )
-		{
-			v40 = &outz;
-			v39 = &outy;
-			v38 = &outx;
-			v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
-			*(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
-			v36 = 0;
-			v35 = 8;
-			Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
-			break;
-		}
-		if ( v4 == 1 )
-		{
-			v40 = &outz;
-			v39 = &outy;
-			v38 = &outx;
-			v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
-			v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
-			*(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
-			v36 = 0;
-			v35 = 24;
-			Vec3_int_::Rotate(v35, v18, v36, v37, v38, v39, v40);
-			break;
-		}
-		}
-	case OBJECT_Decoration:
-		{
-		v12 = v4;
-		outx = pLevelDecorations[v12].vPosition.x;
-		v13 = pLevelDecorations[v12].vPosition.y;
-		v14 = pLevelDecorations[v12].vPosition.z;
-		outy = v13;
-		outz = v14;
-		break;
-		}
-	default:
-		{
-		outz = 0;
-		outy = 0;
-		outx = 0;
-		break;
-		}
-	case OBJECT_BModel:
-		{
-		if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
-		{
-			v10 = &pIndoor->pFaces[v4];
-			outx = (v10->pBounding.x1 + v10->pBounding.x2) >> 1;
-			outy = (v10->pBounding.y1 + v10->pBounding.y2) >> 1;
-			v11 = (v10->pBounding.z1 + v10->pBounding.z2) >> 1;
-			outz = v11;
-		}
-		break;
-		}
+    case OBJECT_Item:
+    {
+      outx = pSpriteObjects[v4].vPosition.x;
+      outy = pSpriteObjects[v4].vPosition.y;
+      outz = pSpriteObjects[v4].vPosition.z;
+      break;
+    }
+    case OBJECT_Actor:
+    {
+      outx = pActors[v4].vPosition.x;
+      outy = pActors[v4].vPosition.y;
+      outz = pActors[v4].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v4].uActorHeight * -0.75);
+      break;
+    }
+    case OBJECT_Player:
+    {
+      if ( !v4 )
+      {
+        outx = pParty->vPosition.x;
+        outy = pParty->vPosition.y;
+        outz = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        break;
+      }
+      if ( v4 == 4 )
+      {
+        v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
+        v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        *(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
+        Vec3_int_::Rotate(24, v18, 0, v37, &outx, &outy, &outz);
+        break;
+      }
+      if ( v4 == 3 )
+      {
+        v18 = pParty->sRotationY - stru_5C6E00->uIntegerHalfPi;
+        v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        *(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
+        Vec3_int_::Rotate(8, v18, 0, v37, &outx, &outy, &outz);
+        break;
+      }
+      if ( v4 == 2 )
+      {
+        v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
+        *(_QWORD *)&v37.x = *(_QWORD *)&pParty->vPosition.x;
+        Vec3_int_::Rotate(8, v18, 0, v37, &outx, &outy, &outz);
+        break;
+      }
+      if ( v4 == 1 )
+      {
+        v37.z = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
+        v18 = stru_5C6E00->uIntegerHalfPi + pParty->sRotationY;
+        *(_QWORD *)&v37 = *(_QWORD *)&pParty->vPosition.x;
+        Vec3_int_::Rotate(24, v18, 0, v37, &outx, &outy, &outz);
+        break;
+      }
+    }
+    case OBJECT_Decoration:
+    {
+      outx = pLevelDecorations[v4].vPosition.x;
+      outy = pLevelDecorations[v4].vPosition.y;
+      outz = pLevelDecorations[v4].vPosition.z;
+      break;
+    }
+    default:
+    {
+      outz = 0;
+      outy = 0;
+      outx = 0;
+      break;
+    }
+    case OBJECT_BModel:
+    {
+      if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
+      {
+        outx = (pIndoor->pFaces[v4].pBounding.x1 + pIndoor->pFaces[v4].pBounding.x2) >> 1;
+        outy = (pIndoor->pFaces[v4].pBounding.y1 + pIndoor->pFaces[v4].pBounding.y2) >> 1;
+        outz = (pIndoor->pFaces[v4].pBounding.z1 + pIndoor->pFaces[v4].pBounding.z2) >> 1;
+      }
+      break;
+    }
   }
-  v20 = v6;
-  v21 = PID_TYPE(v6);
-  v22 = PID_ID(v20);
-  switch(v21)
+
+  switch( PID_TYPE(uObj2ID) )
   {
-	case OBJECT_Item:
-		{
-		v30 = v22;
-		LODWORD(v45) = pSpriteObjects[v30].vPosition.x;
-		v27 = pSpriteObjects[v30].vPosition.y;
-		v28 = pSpriteObjects[v30].vPosition.z;
-		LODWORD(v44) = v27;
-		a4 = v28;
-		break;
-	    }
-	case OBJECT_Actor:
-		{
-		LODWORD(v45) = pActors[v22].vPosition.x;
-		LODWORD(v44) = pActors[v22].vPosition.y;
-		v25 = pActors[v22].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v22].uActorHeight * -0.75);
-		a4 = v25;
-		break;
-		}
-	case OBJECT_Player:
-		{
-		LODWORD(v45) = pParty->vPosition.x;
-		LODWORD(v44) = pParty->vPosition.y;
-		v29 = a4;
-		if ( !a4 )
-		  v29 = pParty->sEyelevel;
-		v28 = pParty->vPosition.z + v29;
-		a4 = v28;
-		break;
-		}
-	case OBJECT_Decoration:
-		{
-	    v26 = v22;
-		LODWORD(v45) = pLevelDecorations[v26].vPosition.x;
-		v27 = pLevelDecorations[v26].vPosition.y;
-		v28 = pLevelDecorations[v26].vPosition.z;
-		LODWORD(v44) = v27;
-		a4 = v28;
-		break;
-		}
-	default:
-		{
-		a4 = 0;
-		v44 = 0.0;
-		v45 = 0.0;
-		break;
-		}
-	case OBJECT_BModel:
-		{
-		if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
-		{
-			v23 = &pIndoor->pFaces[v22];
-			v24 = v23->pBounding.y1;
-			LODWORD(v45) = (v23->pBounding.x1 + v23->pBounding.x2) >> 1;
-			LODWORD(v44) = (v24 + v23->pBounding.y2) >> 1;
-			v25 = (v23->pBounding.z1 + v23->pBounding.z2) >> 1;
-			a4 = v25;
-		}
-		break;
-		}
+    case OBJECT_Item:
+    {
+      outx2 = pSpriteObjects[v5].vPosition.x;
+      outy2 = pSpriteObjects[v5].vPosition.y;
+      a4 = pSpriteObjects[v5].vPosition.z;
+      break;
+    }
+    case OBJECT_Actor:
+    {
+      outx2 = pActors[v5].vPosition.x;
+      outy2 = pActors[v5].vPosition.y;
+      a4 = pActors[v5].vPosition.z - (unsigned int)(signed __int64)((double)pActors[v5].uActorHeight * -0.75);
+      break;
+    }
+    case OBJECT_Player:
+    {
+      outx2 = pParty->vPosition.x;
+      outy2 = pParty->vPosition.y;
+      if ( !a4 )
+        a4 = pParty->sEyelevel;
+      a4 = pParty->vPosition.z + a4;
+      break;
+    }
+    case OBJECT_Decoration:
+    {
+      outx2 = pLevelDecorations[v5].vPosition.x;
+      outy2 = pLevelDecorations[v5].vPosition.y;
+      a4 = pLevelDecorations[v5].vPosition.z;
+      break;
+    }
+    default:
+    {
+      outx2 = 0.0;
+      outy2 = 0.0;
+      a4 = 0;
+      break;
+    }
+    case OBJECT_BModel:
+    {
+      if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
+      {
+        outx2 = (pIndoor->pFaces[v5].pBounding.x1 + pIndoor->pFaces[v5].pBounding.x2) >> 1;
+        outy2 = (pIndoor->pFaces[v5].pBounding.y1 + pIndoor->pFaces[v5].pBounding.y2) >> 1;
+        a4 = (pIndoor->pFaces[v5].pBounding.z1 + pIndoor->pFaces[v5].pBounding.z2) >> 1;
+      }
+      break;
+    }
   }
   
-  v31 = (double)SLODWORD(v45) - (double)outx;
+  v31 = (double)outx2 - (double)outx;
   v42 = v31;
-  v32 = (double)SLODWORD(v44) - (double)outy;
+  v32 = (double)outy2 - (double)outy;
   v43 = v32;
   a4a = (double)a4 - (double)outz;
-  v45 = v32 * v32;
-  v44 = v31 * v31;
-  v33 = sqrt(a4a * a4a + v44 + v45);
+  outx2 = v32 * v32;
+  outy2 = v31 * v31;
+  v33 = sqrt(a4a * a4a + outy2 + outx2);
   if ( v33 <= 1.0 )
   {
     v41.vDirection.x = 65536;
@@ -1871,12 +1826,12 @@
     v41.vDirection.y = (signed __int64)(1.0 / v33 * v43 * 65536.0);
     v41.vDirection.z = (signed __int64)(1.0 / v33 * a4a * 65536.0);
     v41.uDistance = (signed __int64)v33;
-    v41.uDistanceXZ = (signed __int64)sqrt(v44 + v45);
+    v41.uDistanceXZ = (signed __int64)sqrt(outy2 + outx2);
     v41.uYawAngle = stru_5C6E00->Atan2((signed __int64)v42, (signed __int64)v43);
     v41.uPitchAngle = stru_5C6E00->Atan2(v41.uDistanceXZ, (signed __int64)a4a);
   }
   result = pOut;
-  memcpy(pOut, &v41, 0x1Cu);
+  memcpy(pOut, &v41, sizeof(AIDirection));
   return result;
 }
 
--- a/UI/Books/UISpellBook.cpp	Wed Jul 03 23:21:29 2013 +0400
+++ b/UI/Books/UISpellBook.cpp	Thu Jul 04 09:21:57 2013 +0600
@@ -182,7 +182,6 @@
     while ( v4 - 1 < 11 );
   }
 
-
   v9 = pMouse->GetCursorPos(&a2);
   v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF;
   if ( v10 )
--- a/mm7_4.cpp	Wed Jul 03 23:21:29 2013 +0400
+++ b/mm7_4.cpp	Thu Jul 04 09:21:57 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