aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Swango <brian.swango@threattrack.com>2014-08-18 20:03:13 -0400
committerBrian Swango <brian.swango@threattrack.com>2014-08-18 20:03:13 -0400
commit87cbe5a2fcb9c381bca87919baee4dad8ae4abd5 (patch)
tree3b1f536f567c8beec9a77dd07ee574e278c8304e /src
parent4a3416627de4bac3c98c62a602fac93ebd94f1e4 (diff)
Core/Loot: Fixes lootable items being able to be moved in inventory, and
also loot generated that uses conditions from being saved to the DB.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Item/Item.cpp8
-rw-r--r--src/server/game/Entities/Player/Player.cpp14
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..eb93c3ef753 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))
{