Fix an issue where CanSpawn would never get invoked on creatures without per-guid script.
This commit is contained in:
1 parent
a83b77485a
commit
aef568cdd1
1 file changed
+4
-1
@@ -1641,7 +1641,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