Core/Unit: For convenience, explicitly redirect CastSpell with nullptr as first argument to the Unit* overloads. No more ->CastSpell((Unit*)nullptr, ...) all over the place!

(cherry picked from commits c7896f3102 and 40c78cac4c)
This commit is contained in:
Treeston
2017-07-21 17:56:55 +02:00
committed by Aokromes
parent ceaa17603e
commit 2dea942944
5 changed files with 10 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ class VoidSpawnSummon : public BasicEvent
bool Execute(uint64 /*time*/, uint32 /*diff*/)
{
_owner->CastSpell((Unit*)nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
_owner->CastSpell(nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
return true;
}
@@ -590,7 +590,7 @@ class spell_summon_blood_elves_script : SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
GetCaster()->CastSpell((Unit*)nullptr, SummonBloodElvesSpells[urand(0,3)], true);
GetCaster()->CastSpell(nullptr, SummonBloodElvesSpells[urand(0,3)], true);
}
void Register() override
@@ -625,7 +625,7 @@ class spell_muru_darkness : SpellScriptLoader
void HandleAfterCast()
{
for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
GetCaster()->CastSpell((Unit*)nullptr, SummonDarkFiendSpells[i], true);
GetCaster()->CastSpell(nullptr, SummonDarkFiendSpells[i], true);
}
void Register() override
@@ -687,7 +687,7 @@ class spell_transform_visual_missile_periodic : public SpellScriptLoader
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
GetTarget()->CastSpell((Unit*)nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
GetTarget()->CastSpell(nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
}
void Register() override
@@ -713,7 +713,7 @@ class spell_summon_blood_elves_periodic : public SpellScriptLoader
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
GetTarget()->CastSpell((Unit*)nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
GetTarget()->CastSpell(nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
}
void Register() override

View File

@@ -242,7 +242,7 @@ class npc_corrupted_soul_fragment : public CreatureScript
if (instance->GetGuidData(DATA_BRONJAHM).GetCounter() != id)
return;
me->CastSpell((Unit*)nullptr, SPELL_CONSUME_SOUL, true);
me->CastSpell(nullptr, SPELL_CONSUME_SOUL, true);
me->DespawnOrUnsummon();
}

View File

@@ -319,7 +319,7 @@ class instance_gundrak : public InstanceMapScript
if (GameObject* altar = GetGameObject(altarId))
if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f))
trigger->CastSpell((Unit*)nullptr, spellId, true);
trigger->CastSpell(nullptr, spellId, true);
// eventId equals statueId
ToggleGameObject(eventId, GO_STATE_READY);

View File

@@ -857,7 +857,7 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader
for (uint8 i = 0; i < 2; ++i)
{
uint32 spellId = SummonSpellsList.front();
GetTarget()->CastSpell((Unit*)nullptr, spellId, true);
GetTarget()->CastSpell(nullptr, spellId, true);
SummonSpellsList.push_back(spellId);
SummonSpellsList.pop_front();
}