mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/SAI: Prevent loading invalid smart_scripts entry (#26508)
(cherry picked from commit 8c0e6e9ee4)
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user