[8094] Overwrite max durability for item at item loading from prototype. Author: VladimirMangos

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-01 17:50:59 -05:00
parent bc2b02708f
commit e379be0349
+10
View File
@@ -380,6 +380,16 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
if(!proto) if(!proto)
return false; 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 // recalculate suffix factor
if(GetItemRandomPropertyId() < 0) if(GetItemRandomPropertyId() < 0)
{ {