fix(Core/LoadSmartAIFromDB): Prevent loading if entryorguid = 0 (#5663)

Co-Authored-By: robinsch <8017650+robinsch@users.noreply.github.com>
This commit is contained in:
Kitzunu
2021-05-09 11:33:01 +02:00
committed by GitHub
parent 6bb8972194
commit 40f2e5e8c1

View File

@@ -128,6 +128,12 @@ void SmartAIMgr::LoadSmartAIFromDB()
SmartScriptHolder temp;
temp.entryOrGuid = fields[0].GetInt32();
if (!temp.entryOrGuid)
{
LOG_ERROR("sql.sql", "SmartAIMgr::LoadSmartAIFromDB: invalid entryorguid (0), skipped loading.");
continue;
}
SmartScriptType source_type = (SmartScriptType)fields[1].GetUInt8();
if (source_type >= SMART_SCRIPT_TYPE_MAX)
{