From 94b5d9bfa1195ad7c32cf51a665b55514dac0938 Mon Sep 17 00:00:00 2001 From: Treeston Date: Thu, 22 Feb 2018 20:31:42 +0100 Subject: 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. --- src/server/game/Scripting/ScriptMgr.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/server/game/Scripting/ScriptMgr.cpp') diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index cbee458c9a0..16c6bc1a281 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -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); -- cgit v1.2.3