Core/Globals: validate creature_template mingold and maxgold fields

This commit is contained in:
ariel- authored and Aokromes committed 2017-12-26 16:29:45 +01:00
1 parent 9877c63aa0
commit c4d135fc03
2 files changed
+8 -1

No files matched your search

+1 -1
View File
@@ -1719,7 +1719,7 @@ void GameEventMgr::SetHolidayEventTime(GameEventData& event)
if (!event.holidayStage) // Ignore holiday
return;
const HolidaysEntry* holiday = sHolidaysStore.LookupEntry(event.holiday_id);
HolidaysEntry const* holiday = sHolidaysStore.LookupEntry(event.holiday_id);
if (!holiday->Date[0] || !holiday->Duration[0]) // Invalid definitions
{
+7
View File
@@ -847,6 +847,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());