Core/SAI: Prevent loading invalid smart_scripts entry (#26508)

(cherry picked from commit 8c0e6e9ee4)
This commit is contained in:
robinsch
2021-05-05 21:35:51 +02:00
committed by Shauren
parent 52fb1b6417
commit f7956ffd1e

View File

@@ -137,6 +137,12 @@ void SmartAIMgr::LoadSmartAIFromDB()
SmartScriptHolder temp;
temp.entryOrGuid = fields[0].GetInt64();
if (!temp.entryOrGuid)
{
TC_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)
{