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.
This commit is contained in:
Brian Swango
2014-08-18 20:03:13 -04:00
parent 4a3416627d
commit 87cbe5a2fc
2 changed files with 8 additions and 14 deletions
+8
View File
@@ -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);
@@ -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))
{