diff options
-rw-r--r-- | src/game/Spell.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3e25d6a91f7..3d439558418 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4499,13 +4499,11 @@ SpellCastResult Spell::CheckCast(bool strict) return SPELL_FAILED_MOVING; } - Unit *target; + Unit *target = m_targets.getUnitTarget(); // In pure self-cast spells, the client won't send any unit target - if (m_targets.getTargetMask() == TARGET_FLAG_SELF || m_targets.getTargetMask() & TARGET_FLAG_CASTER) // TARGET_FLAG_SELF == 0, remember! + if (target && (m_targets.getTargetMask() == TARGET_FLAG_SELF || m_targets.getTargetMask() & TARGET_FLAG_CASTER)) // TARGET_FLAG_SELF == 0, remember! target = m_caster; - else - target = m_targets.getUnitTarget(); if (target) { |