aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Entities/Item/Item.cpp4
-rw-r--r--src/server/game/Handlers/SpellHandler.cpp1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index eeb857d880b..e19f8ddc881 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -457,7 +457,9 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi
SetUInt32Value(ITEM_FIELD_DURABILITY, durability);
// update max durability (and durability) if need
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, proto->MaxDurability);
- if (durability > proto->MaxDurability)
+
+ // do not overwrite durability for wrapped items
+ if (durability > proto->MaxDurability && !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))
{
SetUInt32Value(ITEM_FIELD_DURABILITY, proto->MaxDurability);
need_save = true;
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index c42782141b2..1d5fb796568 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -271,6 +271,7 @@ void WorldSession::HandleOpenWrappedItemCallback(uint16 pos, ObjectGuid itemGuid
item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, ObjectGuid::Empty);
item->SetEntry(entry);
item->SetUInt32Value(ITEM_FIELD_FLAGS, flags);
+ item->SetUInt32Value(ITEM_FIELD_MAXDURABILITY, item->GetTemplate()->MaxDurability);
item->SetState(ITEM_CHANGED, GetPlayer());
GetPlayer()->SaveInventoryAndGoldToDB(trans);