diff options
-rw-r--r-- | src/server/game/Entities/Item/Item.cpp | 8 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 14 |
2 files changed, 8 insertions, 14 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 09911fc8f57..6894dd86493 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -1265,6 +1265,14 @@ void Item::ItemContainerSaveLootToDB() // but we don't want to resave it. if (!_li->canSave) continue; + // Conditions are not checked when loot is generated, it is checked when loot is sent to a player. + // For items that are lootable, loot is saved to the DB immediately, that means that loot can be + // saved to the DB that the player never should have gotten. This check prevents that, so that only + // items that the player should get in loot are in the DB. + // IE: Horde items are not saved to the DB for Ally players. + Player* const guid = GetOwner(); + if (!_li->AllowedForPlayer(guid)) + continue; stmt_items = CharacterDatabase.GetPreparedStatement(CHAR_INS_ITEMCONTAINER_ITEMS); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index fa009d94fe2..c9ac4e73374 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -13176,13 +13176,6 @@ void Player::SwapItem(uint16 src, uint16 dst) // SRC checks - if (pSrcItem->m_lootGenerated) // prevent swap looting item - { - //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL); - return; - } - // check unequip potability for equipped items and bank bags if (IsEquipmentPos(src) || IsBagPos(src)) { @@ -13213,13 +13206,6 @@ void Player::SwapItem(uint16 src, uint16 dst) if (pDstItem) { - if (pDstItem->m_lootGenerated) // prevent swap looting item - { - //best error message found for attempting to swap while looting - SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pDstItem, NULL); - return; - } - // check unequip potability for equipped items and bank bags if (IsEquipmentPos(dst) || IsBagPos(dst)) { |