diff mm7_6.cpp @ 515:cb0ad52d6a26

LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people) Some object-related subs moved to SpriteObject.cpp
author Nomad
date Fri, 01 Mar 2013 21:13:12 +0200
parents cc4b7981c1bb
children 35f28d4c0ff9
line wrap: on
line diff
--- a/mm7_6.cpp	Fri Mar 01 18:23:49 2013 +0200
+++ b/mm7_6.cpp	Fri Mar 01 21:13:12 2013 +0200
@@ -20,7 +20,7 @@
 #include "Viewport.h"
 #include "FrameTableInc.h"
 #include "Math.h"
-#include "LayingItem.h"
+#include "SpriteObject.h"
 #include "ObjectList.h"
 #include "Chest.h"
 #include "PaletteManager.h"
@@ -2578,9 +2578,9 @@
   //unsigned __int64 v28; // qax@102
   int v29; // ecx@105
   int v30; // ecx@106
-  int v31; // eax@112
-  int v32; // eax@112
-  char *v33; // edx@113
+  //int v31; // eax@112
+  //int v32; // eax@112
+  //char *v33; // edx@113
   int v34; // eax@121
   int v35; // eax@123
   int v36; // edx@125
@@ -3269,7 +3269,7 @@
   signed int sRecoveryTime; // [sp+DD0h] [bp-B4h]@53
   char *y; // [sp+DD4h] [bp-B0h]@325
   int v721; // [sp+DD8h] [bp-ACh]@163
-  //LayingItem a1; // [sp+DDCh] [bp-A8h]@1
+  //SpriteObject a1; // [sp+DDCh] [bp-A8h]@1
   int v723; // [sp+E4Ch] [bp-38h]@1
   ItemGen *_this; // [sp+E50h] [bp-34h]@23
   float v725; // [sp+E54h] [bp-30h]@23
@@ -3291,8 +3291,8 @@
 
   v711 = ecx0;
 
-  LayingItem a1; // [sp+DDCh] [bp-A8h]@1
-  //LayingItem::LayingItem(&a1);
+  SpriteObject a1; // [sp+DDCh] [bp-A8h]@1
+  //SpriteObject::SpriteObject(&a1);
 
   //v1 = 0;
   v2 = 0;
@@ -3336,8 +3336,8 @@
     }
 
 
-    a1.uItemType = stru_4E3ACC[v3->spellnum].field_0;
-    if (a1.uItemType)
+    a1.uType = stru_4E3ACC[v3->spellnum].field_0;
+    if (a1.uType)
     {
       if ( (a2 & 7) == OBJECT_Actor)
       {
@@ -3460,8 +3460,9 @@
 
     switch ( v3->spellnum )
     {
+      case SPELL_101:
+        assert(false && "Unknown spell effect #101 (prolly flaming bow arrow");
       case SPELL_BOW_ARROW:
-      case SPELL_101:
         v17 = pPlayer;
         _this = (ItemGen *)1;
         if ( (signed int)SkillToMastery(pPlayer->pActiveSkills[PLAYER_SKILL_BOW]) >= 3 )
@@ -3472,7 +3473,7 @@
         a1.field_4C = v2;
         a1.field_48 = v18;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         if ( v17->WearsItem(510, 2) )
           a1.uObjectDescID = pObjectList->ObjectIDByItemID(0xBD6u);
         a1.vPosition.x = pParty->vPosition.x;
@@ -3513,7 +3514,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v723;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
@@ -3565,7 +3566,7 @@
         pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].Apply(pParty->uTimePlayed + (signed __int64)((double)(signed int)3600 * v2 * 4.2666669), v731, amount, 0, 0);
         goto LABEL_1056;
 
-      case 7:
+      case SPELL_FIRE_FIRE_SPIKE:
         v29 = v12 - 2;
         if ( v29 )
         {
@@ -3586,14 +3587,19 @@
         {
           amount = 5;
         }
-        v31 = v3->uPlayerID;
+        //v31 = v3->uPlayerID;
+        //v32 = 8 * v31;
+        //LOBYTE(v32) = v32 | OBJECT_Player;
+
+        //if ( (signed int)uNumSpriteObjects > 0 )
         HIDWORD(v733) = 0;
-        v32 = 8 * v31;
-        LOBYTE(v32) = v32 | OBJECT_Player;
-        if ( (signed int)uNumLayingItems > 0 )
-        {
-          v33 = (char *)&pLayingItems[0].field_48;
-          v730 = uNumLayingItems;
+        for (uint i = 0; i < uNumSpriteObjects; ++i)
+        {
+          auto object = pSpriteObjects + i;
+          if (object->uType && object->field_48 == 7 && object->field_58_pid == 8 * (int)v3->uPlayerID | OBJECT_Player)
+            ++HIDWORD(v733);
+          /*v33 = (char *)&pSpriteObjects[0].field_48;
+          v730 = uNumSpriteObjects;
           do
           {
             if ( *((short *)v33 - 36) && *(int *)v33 == 7 && *((int *)v33 + 4) == v32 )
@@ -3601,17 +3607,18 @@
             v33 += 112;
             --v730;
           }
-          while ( v730 );
+          while ( v730 );*/
         }
         if ( SHIDWORD(v733) > amount )
           goto LABEL_200;
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
+
         a1.stru_24.Reset();
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = 0;
@@ -3648,7 +3655,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -3687,7 +3694,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -3724,7 +3731,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = *(short *)(HIDWORD(v733) + 142);
         a1.vPosition.y = *(short *)(HIDWORD(v733) + 144);
         v48 = *(short *)(HIDWORD(v733) + 138);
@@ -3769,7 +3776,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = 0;
@@ -3801,7 +3808,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
         a1.vPosition.y = pParty->vPosition.y;
         v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 2;
@@ -3908,14 +3915,14 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
+        v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = a2 >> 3;
         goto LABEL_1086;
       case 92:
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
         a1.stru_24.Reset();
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
@@ -4310,7 +4317,7 @@
             a1.field_48 = *(int *)HIDWORD(v733);
             a1.field_4C = v723;
             a1.field_50 = v731;
-            a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+            a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
             a1.uAttributes = 0;
             a1.uSectorID = 0;
             a1.uSpriteFrameID = 0;
@@ -4492,7 +4499,7 @@
             a1.field_48 = v3->spellnum;
             a1.field_4C = v2;
             a1.field_50 = v731;
-            a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+            a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
             a1.uAttributes = 0;
             a1.vPosition.x = uRequiredMana;
             a1.vPosition.y = LODWORD(v727);
@@ -4539,7 +4546,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -4662,7 +4669,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = 0;
@@ -4856,7 +4863,7 @@
           a1.field_48 = v3->spellnum;
           a1.field_4C = v2;
           a1.field_50 = v731;
-          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.uAttributes = 0;
           a1.vPosition.x = LODWORD(v718);
           a1.vPosition.y = v713;
@@ -4945,7 +4952,7 @@
           a1.field_48 = v3->spellnum;
           a1.field_50 = v731;
           a1.field_4C = v2;
-          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.vPosition.y = pParty->vPosition.y;
           v51 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
           v671 = pParty->vPosition.z + (signed int)pParty->uPartyHeight / 3;
@@ -4983,7 +4990,7 @@
           a1.field_48 = v3->spellnum;
           a1.field_4C = v2;
           a1.field_50 = v731;
-          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+          a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
           a1.vPosition.y = pParty->vPosition.y;
           a1.vPosition.x = pParty->vPosition.x;
           a1.uAttributes = 0;
@@ -5560,7 +5567,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.y = pParty->vPosition.y;
         a1.vPosition.x = pParty->vPosition.x;
         a1.uAttributes = 0;
@@ -5588,12 +5595,12 @@
           goto LABEL_200;
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
-        a1.uItemType = 4090;
+        a1.uType = 4090;
         a1.stru_24.Reset();
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
@@ -5780,12 +5787,12 @@
           goto play_sound_and_continue;
         v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
         pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xFFFFFFu, 0xC0u);
-        ++a1.uItemType;
+        ++a1.uType;
         a1.stru_24.Reset();
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -6120,7 +6127,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = *(short *)(v730 + 142);
         a1.vPosition.y = *(short *)(v730 + 144);
         v676 = *(short *)(v730 + 138);
@@ -6166,7 +6173,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
+        v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v426;
         goto LABEL_1086;
       case 66:
@@ -6192,7 +6199,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
+        v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v427;
         goto LABEL_1086;
       case 63:
@@ -6206,12 +6213,12 @@
           goto play_sound_and_continue;
         v726 = (Player *)sub_46A6AC((int)dword_50BF30, 100, 4096);
         pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xA0A0Au, 0xC0u);
-        ++a1.uItemType;
+        ++a1.uType;
         a1.stru_24.Reset();
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -6300,7 +6307,7 @@
         v445 = a2 >> 3;
         if ( (a2 & 7) == OBJECT_Item)
         {
-          v449 = (char *)&pLayingItems[v445].stru_24;
+          v449 = (char *)&pSpriteObjects[v445].stru_24;
           v450 = *(int *)v449;
           if ( pItemsTable->pItems[v450].uEquipType == 18 )
           {
@@ -6311,10 +6318,10 @@
           {
             sprintf(pTmpBuf2, (char*)pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v450].pUnidentifiedName);
             ShowStatusBarString(pTmpBuf2, 2u);
-            if ( !pParty->AddItem(&pLayingItems[v445].stru_24) )
-              pParty->SetHoldingItem(&pLayingItems[v445].stru_24);
+            if ( !pParty->AddItem(&pSpriteObjects[v445].stru_24) )
+              pParty->SetHoldingItem(&pSpriteObjects[v445].stru_24);
           }
-          LayingItem::OnItemPickup(v445);
+          SpriteObject::OnInteraction(v445);
         }
         else
         {
@@ -6626,7 +6633,7 @@
 
         pGame->GetStru6()->FadeScreen__like_Turn_Undead_and_mb_Armageddon(0xAFF0Au, 0xC0u);
         v505 = sub_46A6AC((int)dword_50BF30, 100, 4096);
-        ++a1.uItemType;
+        ++a1.uType;
         HIDWORD(v733) = v505;
         v690 = 0;
         v689 = 0;
@@ -6635,7 +6642,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -6789,7 +6796,7 @@
         if ( !pPlayer->CanCastSpell(uRequiredMana) )
           goto play_sound_and_continue;
         v531 = sub_46A6AC((int)dword_50BF30, 100, 4096);
-        ++a1.uItemType;
+        ++a1.uType;
         v726 = (Player *)v531;
         v696 = 0;
         v695 = 0;
@@ -6798,7 +6805,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -7014,12 +7021,12 @@
         v721 = v578;
         if ( *(short *)(v578 + 40) > 0 || (v579 = *(short *)(v578 + 176), v579 != 5) && v579 != 4 )
           goto LABEL_200;
-        ++a1.uItemType;
+        ++a1.uType;
         a1.stru_24.Reset();
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -7118,7 +7125,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.vPosition.x = pParty->vPosition.x;
         a1.vPosition.y = pParty->vPosition.y;
         a1.uAttributes = 0;
@@ -7192,7 +7199,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        v60 = pObjectList->ObjectIDByItemID(a1.uItemType);
+        v60 = pObjectList->ObjectIDByItemID(a1.uType);
         v61 = v599;
 LABEL_1086:
         v600 = pActors[v61].vPosition.y;
@@ -7340,7 +7347,7 @@
         a1.field_48 = v3->spellnum;
         a1.field_4C = v2;
         a1.field_50 = v731;
-        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uItemType);
+        a1.uObjectDescID = pObjectList->ObjectIDByItemID(a1.uType);
         a1.uAttributes = 0;
         a1.uSectorID = 0;
         a1.uSpriteFrameID = 0;
@@ -8114,131 +8121,6 @@
   return result;
 }
 
-//----- (0042F5ED) --------------------------------------------------------
-int LayingItem::Create(int yaw, int pitch, int a4, int a5)
-{
-  LayingItem *v5; // eax@1
-  signed int v6; // ebx@2
-  char *v7; // ecx@2
-  signed int result; // eax@6
-  LayingItem *v9; // ebx@7
-  int v10; // edx@11
-  int v11; // edi@18
-  __int16 v12; // ax@18
-  int v13; // ST2C_4@20
-  int v14; // eax@20
-  int v15; // [sp-28h] [bp-38h]@14
-  int v16; // [sp-24h] [bp-34h]@11
-  Vec3_int_ v17; // [sp-20h] [bp-30h]@11
-  int *v18; // [sp-14h] [bp-24h]@11
-  int *v19; // [sp-10h] [bp-20h]@11
-  int *v20; // [sp-Ch] [bp-1Ch]@11
-  signed int v21; // [sp+8h] [bp-8h]@2
-  int angle; // [sp+Ch] [bp-4h]@1
-  int a4a; // [sp+1Ch] [bp+Ch]@20
-  int a4b; // [sp+1Ch] [bp+Ch]@20
-  int a5a; // [sp+20h] [bp+10h]@20
-
-  auto a1 = this;
-  angle = yaw;
-  v5 = a1;
-  if ( !a1->uObjectDescID )
-    return -1;
-  v6 = 0;
-  v7 = (char *)&pLayingItems[0].uObjectDescID;
-  v21 = 0;
-  do
-  {
-    if ( !*(short *)v7 )
-      break;
-    v7 += 112;
-    ++v6;
-    v21 = v6;
-  }
-  while ( (signed int)v7 < (signed int)((char *)&pObjectList->uNumObjects + 2) );
-  if ( v6 >= 1000 )
-    return -1;
-  *(int *)&v5->field_62[2] = v5->vPosition.x;
-  *(int *)&v5->field_62[6] = v5->vPosition.y;
-  v9 = &pLayingItems[v6];
-  *(int *)&v5->field_62[10] = v5->vPosition.z;
-  memcpy(v9, v5, 0x70u);
-  if ( a5 == 1 )
-  {
-    v20 = &v9->vPosition.z;
-    v19 = &v9->vPosition.y;
-    v18 = (int *)&v9->vPosition;
-    v17.z = v5->vPosition.z;
-    *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
-    v16 = 0;
-    v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
-    goto LABEL_16;
-  }
-  if ( a5 == 2 )
-  {
-    v20 = &v9->vPosition.z;
-    v19 = &v9->vPosition.y;
-    v18 = (int *)&v9->vPosition;
-    v17.z = v5->vPosition.z;
-    *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
-    v16 = 0;
-    v10 = stru_5C6E00->uIntegerHalfPi + v9->uFacing;
-    goto LABEL_14;
-  }
-  if ( a5 == 3 )
-  {
-    v20 = &v9->vPosition.z;
-    v19 = &v9->vPosition.y;
-    v18 = (int *)&v9->vPosition;
-    v17.z = v5->vPosition.z;
-    *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
-    v16 = 0;
-    v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
-LABEL_14:
-    v15 = 8;
-LABEL_17:
-    Vec3_int_::Rotate(v15, v10, v16, v17, v18, v19, v20);
-    goto LABEL_18;
-  }
-  if ( a5 == 4 )
-  {
-    v20 = &v9->vPosition.z;
-    v19 = &v9->vPosition.y;
-    v18 = (int *)&v9->vPosition;
-    v17.z = v5->vPosition.z;
-    *(_QWORD *)&v17.x = *(_QWORD *)&v5->vPosition.x;
-    v16 = 0;
-    v10 = v9->uFacing - stru_5C6E00->uIntegerHalfPi;
-LABEL_16:
-    v15 = 24;
-    goto LABEL_17;
-  }
-LABEL_18:
-  v11 = a4;
-  v12 = 0;
-  if ( a4 )
-  {
-    a4a = stru_5C6E00->Cos(angle);
-    v13 = (unsigned __int64)(a4a * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
-    a4b = stru_5C6E00->Sin(angle);
-    a5a = (unsigned __int64)(a4b * (signed __int64)stru_5C6E00->Cos(pitch)) >> 16;
-    v14 = stru_5C6E00->Sin(pitch);
-    v9->vVelocity.x = (unsigned int)(v13 * v11) >> 16;
-    v9->vVelocity.y = (unsigned int)(a5a * v11) >> 16;
-    v12 = (unsigned int)(v14 * v11) >> 16;
-  }
-  else
-  {
-    v9->vVelocity.y = 0;
-    v9->vVelocity.x = 0;
-  }
-  v9->vVelocity.z = v12;
-  result = v21;
-  if ( v21 >= (signed int)uNumLayingItems )
-    uNumLayingItems = v21 + 1;
-  return result;
-}
-
 //----- (0042F7EB) --------------------------------------------------------
 bool __fastcall sub_42F7EB_DropItemAt(unsigned int uSpriteID, int x, int y, int z, int a4, int count, int a7, unsigned __int16 attributes, ItemGen *a9)
 {
@@ -8252,7 +8134,7 @@
   int v16; // eax@18
   int v17; // edi@20
   int v18; // esi@20
-  //LayingItem a1a; // [sp+Ch] [bp-78h]@1
+  //SpriteObject a1a; // [sp+Ch] [bp-78h]@1
   int v21; // [sp+7Ch] [bp-8h]@1
   unsigned int v22; // [sp+80h] [bp-4h]@1
 
@@ -8260,8 +8142,8 @@
   v21 = x;
   v22 = uSpriteID;
 
-  LayingItem a1a; // [sp+Ch] [bp-78h]@1
-  //LayingItem::LayingItem(&a1a);
+  SpriteObject a1a; // [sp+Ch] [bp-78h]@1
+  //SpriteObject::SpriteObject(&a1a);
   a1a.stru_24.Reset();
 
   if ( a9 )
@@ -8274,7 +8156,7 @@
   a1a.field_4C = 0;
   a1a.field_48 = 0;
   a1a.field_54 = 0;
-  a1a.uItemType = v9;
+  a1a.uType = v9;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
   {
 LABEL_7:
@@ -8366,13 +8248,13 @@
   unsigned __int16 v7; // ax@5
   signed int v8; // eax@6
   signed int v9; // eax@7
-  //LayingItem a1; // [sp+Ch] [bp-70h]@1
+  //SpriteObject a1; // [sp+Ch] [bp-70h]@1
 
   v3 = x;
   v4 = y;
   
-  LayingItem a1; // [sp+Ch] [bp-70h]@1
-  //LayingItem::LayingItem(&a1);
+  SpriteObject a1; // [sp+Ch] [bp-70h]@1
+  //SpriteObject::SpriteObject(&a1);
   a1.stru_24.Reset();
 
   v5 = 0;
@@ -8380,7 +8262,7 @@
   a1.field_4C = 0;
   a1.field_48 = 0;
   a1.field_54 = 0;
-  a1.uItemType = 800;
+  a1.uType = 800;
   if ( (signed int)pObjectList->uNumObjects <= 0 )
   {
 LABEL_5:
@@ -8418,18 +8300,18 @@
 }
 
 //----- (0042FA22) --------------------------------------------------------
-LayingItem *__cdecl sub_42FA22_mess_with_laying_item_list()
+SpriteObject *__cdecl sub_42FA22_mess_with_laying_item_list()
 {
   size_t v0; // edx@1
   int v1; // ebp@1
-  LayingItem *result; // eax@1
-  LayingItem *v3; // ebx@1
+  SpriteObject *result; // eax@1
+  SpriteObject *v3; // ebx@1
 
   v0 = 0;
   v1 = 0;
-  //result = (char *)&pLayingItems[0].uObjectDescID;
-  result = pLayingItems;
-  v3 = pLayingItems;
+  //result = (char *)&pSpriteObjects[0].uObjectDescID;
+  result = pSpriteObjects;
+  v3 = pSpriteObjects;
   do
   {
 	if ( result->uObjectDescID )
@@ -8446,8 +8328,8 @@
     ++v1;
   }
   //while ( (signed int)result < (signed int)((char *)&pObjectList->uNumObjects + 2) );
-  while( result <= &pLayingItems[999] );
-  uNumLayingItems = v0;
+  while( result <= &pSpriteObjects[999] );
+  uNumSpriteObjects = v0;
   return result;
 }
 
@@ -8461,14 +8343,14 @@
   int v10; // eax@10
   signed int result; // eax@11
   __int16 v12; // ax@12
-  //LayingItem a1a; // [sp+Ch] [bp-74h]@1
+  //SpriteObject a1a; // [sp+Ch] [bp-74h]@1
   int v14; // [sp+7Ch] [bp-4h]@1
 
   v6 = a1;
   v7 = a2;
-  LayingItem a1a; // [sp+Ch] [bp-74h]@1
-  //LayingItem::LayingItem(&a1a);
-  a1a.uItemType = 600;
+  SpriteObject a1a; // [sp+Ch] [bp-74h]@1
+  //SpriteObject::SpriteObject(&a1a);
+  a1a.uType = 600;
   a1a.stru_24.Reset();
 
   a1a.field_48 = 6;
@@ -8483,7 +8365,7 @@
   else
   {
     v8 = (char *)&pObjectList->pObjects->uObjectID;
-    while ( (short)a1a.uItemType != *(short *)v8 )
+    while ( (short)a1a.uType != *(short *)v8 )
     {
       ++v14;
       v8 += 56;