aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index e4519b03404..bb75f535ce9 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -614,14 +614,19 @@ class spell_sha_fire_nova : public SpellScriptLoader
SpellCastResult CheckFireTotem()
{
+ Unit* caster = GetCaster();
// fire totem
- if (!GetCaster()->m_SummonSlot[1])
+ if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]))
+ {
+ if (!caster->IsWithinDistInMap(totem, caster->GetSpellMaxRangeForTarget(totem, GetSpellInfo())))
+ return SPELL_FAILED_OUT_OF_RANGE;
+ return SPELL_CAST_OK;
+ }
+ else
{
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
return SPELL_FAILED_CUSTOM_ERROR;
}
-
- return SPELL_CAST_OK;
}
void HandleDummy(SpellEffIndex /*effIndex*/)