Core/Globals: validate creature_template mingold and maxgold fields

Port From (https://github.com/TrinityCore/TrinityCore/commit/f97e4ad1f462597a0702cfd2130fbac9c46a7eab)
This commit is contained in:
hondacrx
2021-04-16 14:57:13 -04:00
parent 1c3ba180fc
commit 29fd117428
+6
View File
@@ -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);