mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 22:37:04 +00:00
[8094] Overwrite max durability for item at item loading from prototype.
This commit is contained in:
parent
cd913c1f92
commit
c8d07d6e72
2 changed files with 11 additions and 1 deletions
|
|
@ -377,6 +377,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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue