diff options
| author | xinef1 <w.szyszko2@gmail.com> | 2017-03-20 18:34:20 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2017-03-20 18:34:20 +0100 |
| commit | 81d011170d48e7d4cce7892897d24528254615af (patch) | |
| tree | 26b21cb7cfbfd30246ebdc095edc62fd8db7b970 /src | |
| parent | 4096b02a560499d2cb2f40c67ac0b30ed4c48ffd (diff) | |
Core/Items: Fixed durability problems for wrapped item (#19003)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Item/Item.cpp | 4 | ||||
| -rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 1 |
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); |
