aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Item.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game/Item.cpp b/src/game/Item.cpp
index bc1c1eeeaab..2277637701a 100644
--- a/src/game/Item.cpp
+++ b/src/game/Item.cpp
@@ -380,6 +380,16 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
if(!proto)
return false;
+ // update max durability (and durability) if need
+ if(proto->MaxDurability!= GetUInt32Value(ITEM_FIELD_MAXDURABILITY))
+ {
+ SetUInt32Value(ITEM_FIELD_MAXDURABILITY,proto->MaxDurability);
+ if(GetUInt32Value(ITEM_FIELD_DURABILITY) > proto->MaxDurability)
+ SetUInt32Value(ITEM_FIELD_DURABILITY,proto->MaxDurability);
+
+ need_save = true;
+ }
+
// recalculate suffix factor
if(GetItemRandomPropertyId() < 0)
{