diff options
| author | Treeston <treeston.mmoc@gmail.com> | 2018-08-29 13:50:58 +0200 |
|---|---|---|
| committer | Treeston <treeston.mmoc@gmail.com> | 2018-08-29 13:50:58 +0200 |
| commit | bb953328ee8c4d6a628327ae98731f79c713de24 (patch) | |
| tree | 62ce547aa7739d47d4e22470af250f5e27e79b05 /src | |
| parent | dc86a8e5db549300f7cb7b2243654c105013f929 (diff) | |
Scripts/Spells: Check range to fire totem when casting Fire Nova. Closes #22303.
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 11 |
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*/) |
