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

(cherry picked from commit 8c0e6e9ee454c0a429a8a7b54d281d3378773e64)
This commit is contained in:
robinsch
2022-03-09 14:20:25 +01:00
committed by Shauren
parent 52fb1b6417
commit f7956ffd1e
@@ -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)
{