comparison Player.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 7569c88d9cb0
children ce8ea73e7678
comparison
equal deleted inserted replaced
1275:7569c88d9cb0 1276:f11651288371
9443 } 9443 }
9444 } 9444 }
9445 } 9445 }
9446 // 5B65C4: using guessed type int dword_5B65C4; 9446 // 5B65C4: using guessed type int dword_5B65C4;
9447 // 5B65CC: using guessed type int dword_5B65CC; 9447 // 5B65CC: using guessed type int dword_5B65CC;
9448
9449
9450 //----- (00467E7F) --------------------------------------------------------
9451 void Player::EquipBody(ITEM_EQUIP_TYPE uEquipType)
9452 {
9453 //unsigned int v1; // esi@1
9454 int v2; // ebx@1
9455 Player *v3; // eax@1
9456 int v4; // edx@1
9457 int v5; // esi@2
9458 //int v6; // eax@2
9459 unsigned int v7; // eax@3
9460 ItemGen _this; // [sp+Ch] [bp-30h]@1
9461 //Player *v9; // [sp+30h] [bp-Ch]@1
9462 int v10; // [sp+34h] [bp-8h]@1
9463 int *v11; // [sp+38h] [bp-4h]@1
9464
9465 static unsigned char byte_4E8398[200] = // 4E8398
9466 {
9467 1, // EQUIP_OFF_HAND
9468 1, // EQUIP_MAIN_HAND
9469 2, // EQUIP_BOW
9470 3, // EQUIP_ARMOUR
9471 0, // EQUIP_SHIELD
9472 4, // EQUIP_HELMET
9473 5, // EQUIP_BELT
9474 6, // EQUIP_CLOAK
9475 7, // EQUIP_GAUNTLETS
9476 8, // EQUIP_BOOTS
9477 10, // EQUIP_RING
9478 9, // EQUIP_AMULET
9479 1, // EQUIP_WAND
9480 0, // EQUIP_REAGENT
9481 0, // EQUIP_POTION
9482 0, // EQUIP_SPELL_SCROLL
9483 0, // EQUIP_BOOK
9484 0, // EQUIP_MESSAGE_SCROLL
9485 0, // EQUIP_GOLD
9486 0, // EQUIP_GEM
9487 0, // EQUIP_NONE
9488 // ???
9489 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
9490 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0,
9491 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0,
9492 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9493 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
9494 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 1,
9495 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
9496 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0
9497 };
9498
9499 _this.Reset();
9500 v2 = byte_4E8398[uEquipType];
9501 v3 = pPlayers[uActiveCharacter];
9502 v11 = (int *)&v3->pEquipment.pIndices[v2];
9503 v4 = *v11;
9504 v10 = *v11;
9505 if ( v10 )
9506 {
9507 memcpy(&_this, &pParty->pPickedItem, sizeof(_this));
9508 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9));
9509 *(char *)(v5 + 556) = 0;
9510 pParty->pPickedItem.Reset();
9511 pParty->SetHoldingItem((ItemGen *)(v5 + 532));
9512 _this.uBodyAnchor = v2 + 1;
9513 memcpy((void *)(v5 + 532), &_this, 0x24u);
9514 *v11 = v10;
9515 }
9516 else
9517 {
9518 v7 = v3->FindFreeInventorySlot();
9519 if (v7 >= 0)
9520 {
9521 pParty->pPickedItem.uBodyAnchor = v2 + 1;
9522 memcpy(&v3->pInventoryItems[v7], &pParty->pPickedItem, sizeof(v3->pInventoryItems[v7]));
9523 *v11 = v7 + 1;
9524 pMouse->RemoveHoldingItem();
9525 }
9526 }
9527 }