diff Actor.cpp @ 1935:1cbfb6e50e48

moving _4BBF61_summon_actor under Actor
author Grumpy7
date Wed, 23 Oct 2013 23:15:08 -0700
parents 564898c5882b
children a50511e4f3c6
line wrap: on
line diff
--- a/Actor.cpp	Wed Oct 23 21:21:48 2013 -0700
+++ b/Actor.cpp	Wed Oct 23 23:15:08 2013 -0700
@@ -3578,7 +3578,7 @@
   unsigned __int16 v16; // cx@25
   int v33; // eax@100
   int v40; // ebx@107
-  signed __int64 extraRecoveryTime; // qax@125
+  int extraRecoveryTime; // qax@125
   unsigned __int16 v43; // ax@132
   unsigned __int16 v45; // ax@132
   unsigned __int64 v46; // [sp+Ch] [bp-60h]@6
@@ -3830,7 +3830,7 @@
       if ( pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS )
       {
         v33 = byte_4D864C && pGame->uFlags & 80000 ? 10 * pMonster->uActorRadius : pMonster->uActorRadius;
-        pDecalBuilder->AddBloodsplat(pMonster->vPosition.x, pMonster->vPosition.y, pMonster->vPosition.z, 1.0, 0.0, 0.0, v33, 0, 0);
+        pDecalBuilder->AddBloodsplat((float)pMonster->vPosition.x, (float)pMonster->vPosition.y, (float)pMonster->vPosition.z, 1.0, 0.0, 0.0, (float)v33, 0, 0);
       }
     }
     Actor::Die(uActorID_Monster);
@@ -3859,7 +3859,7 @@
     extraRecoveryTime = 20;
     knockbackValue = 10;
     if ( !pParty->bTurnBasedModeOn )
-      extraRecoveryTime = (signed __int64)(flt_6BE3A8_debug_recmod2 * 42.66666666666666);
+      extraRecoveryTime = (int)(flt_6BE3A8_debug_recmod2 * 42.66666666666666);
     pMonster->pMonsterInfo.uRecoveryTime += extraRecoveryTime;
     if ( bShowDamage  )
     {
@@ -3895,51 +3895,36 @@
   Actor::AddBloodsplatOnDamageOverlay(uActorID_Monster, 1, v61);
 }
 //----- (004BBF61) --------------------------------------------------------
-void __fastcall _4BBF61_summon_actor(int a1, __int16 x, int y, int z)
+void Actor::_4BBF61_summon_actor( int a1, __int16 x, int y, int z )
 {
-  size_t v4; // esi@1
-  int monster_id; // edi@1
-  __int16 v6; // ax@4
   Actor *v7; // esi@5
-  int v8; // eax@5
   MonsterInfo *v9; // edi@5
   MonsterDesc *v10; // ebx@5
-  unsigned __int16 *v11; // ebx@5
   int v12; // ebx@7
   int v13; // eax@8
-  __int16 x_; // [sp+8h] [bp-Ch]@1
-  __int16 v15; // [sp+Ch] [bp-8h]@1
   __int16 v16; // [sp+10h] [bp-4h]@3
-  signed int ya; // [sp+1Ch] [bp+8h]@5
 
-  v4 = uNumActors;
-  monster_id = a1;
-  x_ = x;
-  v15 = a1;
   if (uNumActors < 500)
   {
     v16 = 0;
     if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
     {
-      v6 = pIndoor->GetSector(x, y, z);
-      v4 = uNumActors;
-      v16 = v6;
+      v16 = pIndoor->GetSector(x, y, z);
     }
-    v7 = &pActors[v4];
+    v7 = &pActors[uNumActors];
     v7->Reset();
-    v8 = monster_id;
-    v9 = &pMonsterStats->pInfos[monster_id];
-    v10 = &pMonsterList->pMonsters[v8 - 1];
+    v9 = &pMonsterStats->pInfos[a1];
+    v10 = &pMonsterList->pMonsters[a1 - 1];
     strcpy(v7->pActorName, v9->pName);
     v7->sCurrentHP = LOWORD(v9->uHP);
     memcpy(&v7->pMonsterInfo, v9, 0x58u);
-    v7->word_000086_some_monster_id = v15;
+    v7->word_000086_some_monster_id = a1;
     v7->uActorRadius = v10->uMonsterRadius;
     v7->uActorHeight = v10->uMonsterHeight;
     v7->uMovementSpeed = v10->uMovementSpeed;
-    v7->vInitialPosition.x = x_;
-    v7->vPosition.x = x_;
-    BYTE2(v7->uAttributes) |= 8u;
+    v7->vInitialPosition.x = x;
+    v7->vPosition.x = x;
+    v7->uAttributes |= 80000;
     v7->pMonsterInfo.uTreasureType = 0;
     v7->pMonsterInfo.uTreasureLevel = 0;
     v7->pMonsterInfo.uTreasureDiceSides = 0;
@@ -3954,18 +3939,16 @@
     v7->uGroup = 1;
     v7->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
     v7->PrepareSprites(0);
-    v11 = v10->pSoundSampleIDs;
-    ya = 4;
+    for ( int i = 0; i < 4; i++)
+    {
+      pSoundList->LoadSound(v10->pSoundSampleIDs[i], 0);
+    }
+    v12 = 0;
     do
     {
-      pSoundList->LoadSound((signed __int16)*v11, 0);
-      ++v11;
-      --ya;
+      LOWORD(v13) = pSoundList->LoadSound(v12 + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
+      v12++;
     }
-    while ( ya );
-    v12 = 0;
-    do
-      LOWORD(v13) = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[v9->uSpell1ID], 1u);
     while ( v13 );
     ++uNumActors;
   }