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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user