From 5ae114bad2b86af86b717314f54be233aa1cae5e Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 29 Jun 2009 14:48:42 +0400 Subject: [PATCH] [8094] Overwrite max durability for item at item loading from prototype. --- src/game/Item.cpp | 10 ++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/Item.cpp b/src/game/Item.cpp index 52ed24bdb..0ac47c673 100644 --- a/src/game/Item.cpp +++ b/src/game/Item.cpp @@ -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) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bc81ad8d7..2e4c90e44 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8093" + #define REVISION_NR "8094" #endif // __REVISION_NR_H__ -- 2.11.4.GIT