From 29fd11742856ce8a439a397f30466e4365ec79f9 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Fri, 16 Apr 2021 14:57:13 -0400 Subject: [PATCH] Core/Globals: validate creature_template mingold and maxgold fields Port From (https://github.com/TrinityCore/TrinityCore/commit/f97e4ad1f462597a0702cfd2130fbac9c46a7eab) --- Source/Game/Globals/ObjectManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index e16a9ab8e..34a4a8418 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -2584,6 +2584,12 @@ namespace Game ok = true; } + if (cInfo.MinGold > cInfo.MaxGold) + { + Log.outError(LogFilter.Sql, $"Creature (Entry: {cInfo.Entry}) has `mingold` {cInfo.MinGold} which is greater than `maxgold` {cInfo.MaxGold}, setting `maxgold` to {cInfo.MinGold}."); + cInfo.MaxGold = cInfo.MinGold; + } + if (!CliDB.FactionTemplateStorage.ContainsKey(cInfo.Faction)) { Log.outError(LogFilter.Sql, "Creature (Entry: {0}) has non-existing faction template ({1}). This can lead to crashes, set to faction 35", cInfo.Entry, cInfo.Faction);