diff options
author | Shauren <shauren.trinity@gmail.com> | 2013-01-24 17:23:34 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2013-01-24 17:23:34 +0100 |
commit | bf0c976f76d3ae2078f503748888f1eaf5586b2b (patch) | |
tree | 434878e550d64e62a6724ff062c1ed4497248376 | |
parent | 53a3373a985e4c266ed0197e9e537d3de1ffab33 (diff) |
Core/Players: Fixed uninitialized variable for item swaps
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fbc40db790e..66162142fdc 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -11491,7 +11491,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool // should ignore the item we are trying to swap, and not the // destination item. CanEquipUniqueItem should ignore destination // item only when we are swapping weapon from bag - uint8 ignore; + uint8 ignore = uint8(NULL_SLOT); switch (eslot) { case EQUIPMENT_SLOT_MAINHAND: @@ -11513,7 +11513,8 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool ignore = EQUIPMENT_SLOT_TRINKET1; break; } - if (pItem != GetItemByPos(INVENTORY_SLOT_BAG_0, ignore)) + + if (ignore == uint8(NULL_SLOT) || pItem != GetItemByPos(INVENTORY_SLOT_BAG_0, ignore)) ignore = eslot; InventoryResult res2 = CanEquipUniqueItem(pItem, swap ? ignore : uint8(NULL_SLOT)); |