changeset 1886:df873a01767a

Actor::AI_Pursue2 cleaned up
author Grumpy7
date Sat, 19 Oct 2013 07:56:16 +0200
parents 70719fa68500
children 25655815623a
files Actor.cpp
diffstat 1 files changed, 4 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/Actor.cpp	Sat Oct 19 07:26:35 2013 +0200
+++ b/Actor.cpp	Sat Oct 19 07:56:16 2013 +0200
@@ -2234,30 +2234,19 @@
 //----- (0040281C) --------------------------------------------------------
 void Actor::AI_Pursue2(unsigned int uActorID, unsigned int a2, signed int uActionLength, AIDirection *pDir, int a5)
 {
-  unsigned int v5; // edi@1
   int v6; // eax@1
   Actor *v7; // ebx@1
   unsigned int v8; // ecx@1
-  char v9; // zf@1
   AIDirection *v10; // esi@7
-  signed int v11; // edx@12
   signed __int16 v13; // cx@19
   unsigned __int16 v14; // ax@25
-  int v15; // [sp-8h] [bp-54h]@12
-  AIDirection *v16; // [sp-4h] [bp-50h]@12
   AIDirection a3; // [sp+Ch] [bp-40h]@8
   AIDirection v18; // [sp+28h] [bp-24h]@8
-  unsigned int v19; // [sp+44h] [bp-8h]@1
-  unsigned int v20; // [sp+48h] [bp-4h]@1
 
-  v5 = uActorID;
   v6 = 0;
   v7 = &pActors[uActorID];
-  v19 = a2;
   v8 = PID(OBJECT_Actor,uActorID);
-  v9 = v7->pMonsterInfo.uFlying == 0;
-  v20 = v5;
-  if ( !v9 && !pParty->bFlying )
+  if ( v7->pMonsterInfo.uFlying != 0 && !pParty->bFlying )
   {
     if ( v7->pMonsterInfo.uMissleAttack1Type && uCurrentlyLoadedLevelType == LEVEL_Outdoor )
       v6 = v7->uActorRadius + 512;
@@ -2267,29 +2256,20 @@
   v10 = pDir;
   if ( !pDir )
   {
-    memcpy(&v18, Actor::GetDirectionInfo(v8, a2, &a3, v6), sizeof(v18));
-    memcpy(0, &v18, 0x1Cu);
-    v10 = 0;
-    v5 = v20;
+    v10 = Actor::GetDirectionInfo(v8, a2, &a3, v6);
   }
   if ( MonsterStats::BelongsToSupertype(v7->pMonsterInfo.uID, MONSTER_SUPERTYPE_TREANT) )
   {
     if ( !uActionLength )
       uActionLength = 256;
-    v16 = v10;
-    v15 = uActionLength;
-    v11 = 4;
-    Actor::AI_StandOrBored(v5, v11, v15, v16);
+    Actor::AI_StandOrBored(uActorID, 4, uActionLength, v10);
     return;
   }
   if ( (signed int)v10->uDistance < a5 )
   {
     if ( !uActionLength )
       uActionLength = 256;
-    v11 = v19;
-    v16 = v10;
-    v15 = uActionLength;
-    Actor::AI_StandOrBored(v5, v11, v15, v16);
+    Actor::AI_StandOrBored(uActorID, a2, uActionLength, v10);
     return;
   }
   if ( uActionLength )