mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.
This commit is contained in:
@@ -1565,36 +1565,6 @@ bool ScriptMgr::OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo co
|
||||
return tmpscript->OnCastItemCombatSpell(player, victim, spellInfo, item);
|
||||
}
|
||||
|
||||
bool ScriptMgr::CanSpawn(ObjectGuid::LowType spawnId, uint32 entry, CreatureData const* cData, Map const* map)
|
||||
{
|
||||
ASSERT(map);
|
||||
CreatureTemplate const* baseTemplate = sObjectMgr->GetCreatureTemplate(entry);
|
||||
ASSERT(baseTemplate);
|
||||
|
||||
// find out which template we'd be using
|
||||
CreatureTemplate const* actTemplate = baseTemplate;
|
||||
for (uint8 diff = uint8(map->GetSpawnMode()); diff > 0;)
|
||||
{
|
||||
if (uint32 diffEntry = baseTemplate->DifficultyEntry[diff - 1])
|
||||
if (CreatureTemplate const* diffTemplate = sObjectMgr->GetCreatureTemplate(diffEntry))
|
||||
{
|
||||
actTemplate = diffTemplate;
|
||||
break;
|
||||
}
|
||||
if (diff >= RAID_DIFFICULTY_10MAN_HEROIC && map->IsRaid())
|
||||
diff -= 2;
|
||||
else
|
||||
diff -= 1;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
CreatureAI* ScriptMgr::GetCreatureAI(Creature* creature)
|
||||
{
|
||||
ASSERT(creature);
|
||||
|
||||
Reference in New Issue
Block a user