diff mm7_2.cpp @ 1276:f11651288371

changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
author Grumpy7
date Sat, 15 Jun 2013 07:30:26 +0200
parents 0aeac0b9ca30
children 89210052dbb4 62f4cdaa726b
line wrap: on
line diff
--- a/mm7_2.cpp	Sat Jun 15 06:51:04 2013 +0200
+++ b/mm7_2.cpp	Sat Jun 15 07:30:26 2013 +0200
@@ -7986,86 +7986,6 @@
   return uCurrentMenuID;
 }
 
-
-//----- (00467E7F) --------------------------------------------------------
-void sub_467E7F_EquipBody(ITEM_EQUIP_TYPE uEquipType)
-{
-  //unsigned int v1; // esi@1
-  int v2; // ebx@1
-  Player *v3; // eax@1
-  int v4; // edx@1
-  int v5; // esi@2
-  //int v6; // eax@2
-  unsigned int v7; // eax@3
-  ItemGen _this; // [sp+Ch] [bp-30h]@1
-  //Player *v9; // [sp+30h] [bp-Ch]@1
-  int v10; // [sp+34h] [bp-8h]@1
-  int *v11; // [sp+38h] [bp-4h]@1
-
-  static unsigned char byte_4E8398[200] = // 4E8398
-  {
-     1, // EQUIP_OFF_HAND
-     1, // EQUIP_MAIN_HAND
-     2, // EQUIP_BOW
-     3, // EQUIP_ARMOUR
-     0, // EQUIP_SHIELD
-     4, // EQUIP_HELMET
-     5, // EQUIP_BELT
-     6, // EQUIP_CLOAK
-     7, // EQUIP_GAUNTLETS
-     8, // EQUIP_BOOTS
-    10, // EQUIP_RING
-     9, // EQUIP_AMULET
-     1, // EQUIP_WAND
-     0, // EQUIP_REAGENT
-     0, // EQUIP_POTION
-     0, // EQUIP_SPELL_SCROLL
-     0, // EQUIP_BOOK
-     0, // EQUIP_MESSAGE_SCROLL
-     0, // EQUIP_GOLD
-     0, // EQUIP_GEM
-     0, // EQUIP_NONE
-  // ???
-     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
-     0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0,  0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0,
-     0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0,  0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
-     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-     0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,  0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
-     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1,
-     1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-     0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2,  2, 0, 0, 0, 0, 0
-};
-
-  _this.Reset();
-  v2 = byte_4E8398[uEquipType];
-  v3 = pPlayers[uActiveCharacter];
-  v11 = (int *)&v3->pEquipment.pIndices[v2];
-  v4 = *v11;
-  v10 = *v11;
-  if ( v10 )
-  {
-    memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
-    v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
-    *(char *)(v5 + 556) = 0;
-    pParty->pPickedItem.Reset();
-    pParty->SetHoldingItem((ItemGen *)(v5 + 532));
-    _this.uBodyAnchor = v2 + 1;
-    memcpy((void *)(v5 + 532), &_this, 0x24u);
-    *v11 = v10;
-  }
-  else
-  {
-    v7 = v3->FindFreeInventorySlot();
-    if (v7 >= 0)
-    {
-      pParty->pPickedItem.uBodyAnchor = v2 + 1;
-      memcpy(&v3->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v3->pInventoryItems[v7]));
-      *v11 = v7 + 1;
-      pMouse->RemoveHoldingItem();
-    }
-  }
-}
-
 //----- (00467F48) --------------------------------------------------------
 void CreateMsgScrollWindow( signed int mscroll_id )
     {
@@ -8239,7 +8159,7 @@
     }
     if ( pParty->pPickedItem.uItemID == 604 )
     {
-      sub_467E7F_EquipBody((ITEM_EQUIP_TYPE)3);
+      pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)3);
       WetsuitOn(uActiveCharacter);
       return;
     }
@@ -8264,7 +8184,7 @@
 			pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0);
 			return;
 		}
-        sub_467E7F_EquipBody((ITEM_EQUIP_TYPE)v6);
+        pPlayers[uActiveCharacter]->EquipBody((ITEM_EQUIP_TYPE)v6);
         if ( pParty->pPickedItem.uItemID == 604 )
           WetsuitOff(uActiveCharacter);
         return;