Mercurial > mm7
diff Player.cpp @ 1387:297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
author | Grumpy7 |
---|---|
date | Wed, 17 Jul 2013 00:29:58 +0200 |
parents | 72191abc8116 |
children | 60d4885eb107 |
line wrap: on
line diff
--- a/Player.cpp Wed Jul 17 00:19:33 2013 +0200 +++ b/Player.cpp Wed Jul 17 00:29:58 2013 +0200 @@ -880,11 +880,7 @@ int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) { int result; // eax@8 - Texture *texturePtr; // esi@10 - int *v9; // esi@13 - unsigned int widthInSlots; // [sp+0h] [bp-Ch]@10 signed int freeSlot; // [sp+8h] [bp-4h]@4 - unsigned int heightInSlots; // [sp+18h] [bp+Ch]@10 freeSlot = FindFreeInventoryListSlot(); if ( freeSlot == -1 ) @@ -906,8 +902,6 @@ //----- (00492700) -------------------------------------------------------- int Player::HasSkill(unsigned int uSkillType) { - signed int result; // eax@3 - if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) { return 1; @@ -1001,11 +995,6 @@ { signed int freeSlot; // ebx@1 int result; // eax@6 - Texture *item_texture; // esi@7 - int *pInvPos; // esi@10 - unsigned int slot_width; // [sp+4h] [bp-Ch]@7 - unsigned int slot_height; // [sp+8h] [bp-8h]@7 - freeSlot = FindFreeInventoryListSlot(); if ( freeSlot == -1 ) @@ -1100,30 +1089,33 @@ switch (building_type) { - case 1: - if (idemId >= 529) + case BildingType_WeaponShop: + if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) return 5; - if (equipType > 2) + if (equipType > EQUIP_BOW) return 4; break; - case 2: - if (idemId >= 529) + case BildingType_ArmorShop: + if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) return 5; - if ( equipType < 3 || equipType > 9) + if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS) return 4; break; - case 3: - if (idemId >= 529) + case BildingType_MagicShop: + if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) return 5; - if ( pItemsTable->pItems[idemId].uSkillType != 38 ) + if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC ) return 4; break; - case 4: - if ((idemId >= 529 && idemId < 740) || idemId > 771) + case BildingType_AlchemistShop: + if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE) return 5; - if ( !(equipType == 13 || equipType == 14 || equipType == 17)) + if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL)) return 4; break; + default: + assert(false); + break; } if (pItem->Stolen()) return 6; @@ -1145,6 +1137,9 @@ break; case 5: price = this->GetPriceRepair(itemValue, multiplier); + break; + default: + assert(false); break; } if ( merchantLevel )