Core/Player: Added missing change in 8bf7fa369fcbda3a8830dbc45b291634bacfd744
authorjoschiwald <joschiwald.trinity@gmail.com>
Sun, 8 Apr 2018 19:13:16 +0000 (21:13 +0200)
committerjoschiwald <joschiwald.trinity@gmail.com>
Sun, 8 Apr 2018 19:13:16 +0000 (21:13 +0200)
src/server/game/Entities/Player/Player.cpp

index cc868ccf736d3ebf469762220182f5e09a7680e0..ba55f9b85f642ceb11de297b32ea59e7deb25fa4 100644 (file)
@@ -7645,7 +7645,8 @@ void Player::_ApplyWeaponDamage(uint8 slot, Item* item, bool apply)
 
 void Player::CastAllObtainSpells()
 {
 
 void Player::CastAllObtainSpells()
 {
-    for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; ++slot)
+    uint8 inventoryEnd = INVENTORY_SLOT_ITEM_START + GetInventorySlotCount();
+    for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < inventoryEnd; ++slot)
         if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
             ApplyItemObtainSpells(item, true);
 
         if (Item* item = GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
             ApplyItemObtainSpells(item, true);