mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +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)
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8093"
|
#define REVISION_NR "8094"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue