aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-09-11 14:52:19 +0200
committerShauren <shauren.trinity@gmail.com>2025-09-11 14:52:19 +0200
commit70ddb077e621be52184e2c34896cd1635d058542 (patch)
tree06e8b172e74d34afae85c2eade8c56532102e116
parent19382995de1a30ad249388a8b6280dede02d24d5 (diff)
Core/Items: Allow moving openable items that have been opened once (except currently opened item)
Closes #30686 Closes #31184
-rw-r--r--src/server/game/Entities/Player/Player.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 10f9aeffe15..f26b01dc58a 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -10376,8 +10376,8 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des
if (pItem)
{
- // item used
- if (pItem->m_lootGenerated)
+ // swapping/merging with currently looted item
+ if (GetLootGUID() == pItem->GetGUID())
{
if (no_space_count)
*no_space_count = count;
@@ -10880,8 +10880,7 @@ InventoryResult Player::CanStoreItems(Item** items, int count, uint32* itemLimit
if (!pProto)
return EQUIP_ERR_ITEM_NOT_FOUND;
- // item used
- if (item->m_lootGenerated)
+ if (item->m_lootGenerated || GetLootGUID() == item->GetGUID())
return EQUIP_ERR_LOOT_GONE;
// item it 'bind'
@@ -11130,8 +11129,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool
ItemTemplate const* pProto = pItem->GetTemplate();
if (pProto)
{
- // item used
- if (pItem->m_lootGenerated)
+ if (GetLootGUID() == pItem->GetGUID())
return EQUIP_ERR_LOOT_GONE;
if (pItem->IsBindedNotWith(this))
@@ -11297,8 +11295,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
if (!pProto)
return EQUIP_ERR_ITEM_NOT_FOUND;
- // item used
- if (pItem->m_lootGenerated)
+ if (GetLootGUID() == pItem->GetGUID())
return EQUIP_ERR_LOOT_GONE;
if (IsCharmed())
@@ -11336,8 +11333,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest
if (!pProto)
return swap ? EQUIP_ERR_CANT_SWAP : EQUIP_ERR_ITEM_NOT_FOUND;
- // item used
- if (pItem->m_lootGenerated)
+ if (GetLootGUID() == pItem->GetGUID())
return EQUIP_ERR_LOOT_GONE;
if (pItem->IsBindedNotWith(this))