aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-12-19 19:59:36 -0300
committerfunjoker <funjoker109@gmail.com>2021-04-15 05:53:27 +0200
commitf97e4ad1f462597a0702cfd2130fbac9c46a7eab (patch)
tree0ccd9dd4ac20dfce87014c2f4cfba197ed376d13 /src/server/game/Globals/ObjectMgr.cpp
parent526f82bd7282851954a7fcee6fbe25e19513742a (diff)
Core/Globals: validate creature_template mingold and maxgold fields
(cherry picked from commit 5798fda0a027c1199ea4ddd50f5567cf24c74c5b)
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index ee587490ab7..2afa5d6f75c 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -938,6 +938,13 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
ok = true;
}
+ if (cInfo->mingold > cInfo->maxgold)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has `mingold` %u which is greater than `maxgold` %u, setting `maxgold` to %u.",
+ cInfo->Entry, cInfo->mingold, cInfo->maxgold, cInfo->mingold);
+ const_cast<CreatureTemplate*>(cInfo)->maxgold = cInfo->mingold;
+ }
+
if (cInfo->AIName == "TotemAI")
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has not-allowed `AIName` '%s' set, removing", cInfo->Entry, cInfo->AIName.c_str());