Core/Misc: fixed a bunch of GCC warnings

This commit is contained in:
Ovahlord committed 2022-03-21 21:32:41 +01:00
1 parent 9c88c6ea91
commit ca9f34574d
10 files changed
+24 -26

No files matched your search

+10 -11
View File
@@ -4522,19 +4522,18 @@ class spell_gen_blink : public SpellScriptLoader
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
Unit* caster = GetCaster();
if (!caster || !caster->IsCreature())
return;
Creature* creature = caster->ToCreature();
if (Unit* target = creature->GetThreatManager().GetCurrentVictim())
{
if (Creature* caster = GetCaster()->ToCreature())
creature->GetThreatManager().ResetThreat(target);
if (creature->IsAIEnabled())
{
if (Unit* target = caster->GetThreatManager().GetCurrentVictim())
{
caster->GetThreatManager().ResetThreat(target);
if (caster->IsAIEnabled())
{
caster->CastSpell(target, SPELL_BLINK_TARGET, true);
caster->AI()->AttackStart(target);
}
}
creature->CastSpell(target, SPELL_BLINK_TARGET, true);
creature->AI()->AttackStart(target);
}
}
}