mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Globals: validate creature_template mingold and maxgold fields
This commit is contained in:
@@ -1720,7 +1720,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
|
||||
{
|
||||
|
||||
@@ -809,6 +809,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());
|
||||
|
||||
Reference in New Issue
Block a user