aboutsummaryrefslogtreecommitdiff
path: root/src/game/Item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Item.cpp')
-rw-r--r--src/game/Item.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index cbb27666033..4cfd9484f9f 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -705,6 +705,9 @@ bool Item::IsEquipped() const
bool Item::CanBeTraded(bool mail) const
{
+ if (m_lootGenerated)
+ return false;
+
if ((!mail || !IsBoundAccountWide()) && IsSoulBound())
return false;
@@ -766,6 +769,23 @@ bool Item::IsBoundByEnchant() const
return false;
}
+uint8 Item::CanBeMergedPartlyWith(ItemPrototype const* proto) const
+{
+ // not allow merge looting currently items
+ if (m_lootGenerated)
+ return EQUIP_ERR_ALREADY_LOOTED;
+
+ // check item type
+ if (GetEntry() != proto->ItemId)
+ return EQUIP_ERR_ITEM_CANT_STACK;
+
+ // check free space (full stacks can't be target of merge
+ if (GetCount() >= proto->GetMaxStackSize())
+ return EQUIP_ERR_ITEM_CANT_STACK;
+
+ return EQUIP_ERR_OK;
+}
+
bool Item::IsFitToSpellRequirements(SpellEntry const* spellInfo) const
{
ItemPrototype const* proto = GetProto();