mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Fix an issue where CanSpawn would never get invoked on creatures without per-guid script.
(cherry picked from commit aeaa8ecfab)
This commit is contained in:
@@ -1607,7 +1607,10 @@ bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureTemp
|
||||
CreatureTemplate const* baseTemplate = sObjectMgr->GetCreatureTemplate(entry);
|
||||
if (!baseTemplate)
|
||||
baseTemplate = actTemplate;
|
||||
GET_SCRIPT_RET(CreatureScript, (cData ? cData->ScriptId : baseTemplate->ScriptID), tmpscript, true);
|
||||
uint32 scriptId = baseTemplate->ScriptID;
|
||||
if (cData && cData->ScriptId)
|
||||
scriptId = cData->ScriptId;
|
||||
GET_SCRIPT_RET(CreatureScript, scriptId, tmpscript, true);
|
||||
return tmpscript->CanSpawn(spawnId, entry, baseTemplate, actTemplate, cData, map);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user