Use unit target by default (script targets will send self flag usualy)

Fixes quite some new issues like #1466

--HG--
branch : trunk
This commit is contained in:
thenecromancer
2010-04-05 13:15:21 +02:00
parent fc3a1a3a21
commit a1db8825d4
+2 -4
View File
@@ -4499,13 +4499,11 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_MOVING; return SPELL_FAILED_MOVING;
} }
Unit *target; Unit *target = m_targets.getUnitTarget();
// In pure self-cast spells, the client won't send any unit target // 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; target = m_caster;
else
target = m_targets.getUnitTarget();
if (target) if (target)
{ {