Fix an issue where CanSpawn would never get invoked on creatures without per-guid script.

This commit is contained in:
treeston authored and Aokromes committed 2017-05-31 16:10:04 +02:00
1 parent a83b77485a
commit aef568cdd1
1 file changed
+4 -1
+4 -1
View File
@@ -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);
}