aboutsummaryrefslogtreecommitdiff
path: root/src/game/Spell.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-04-05 13:15:21 +0200
committerthenecromancer <none@none>2010-04-05 13:15:21 +0200
commita1db8825d4c19f7a5695735cd6794d1ea2786017 (patch)
tree5b63bd0be0dbb191d265e16912ba001d91d03c77 /src/game/Spell.cpp
parentfc3a1a3a21818bf3845398b709cd84187e9e93f8 (diff)
Use unit target by default (script targets will send self flag usualy)
Fixes quite some new issues like #1466 --HG-- branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r--src/game/Spell.cpp6
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)
{