Core/Spells: Fix a typo (!GetDst() instead of !HasDst()) which prevented from automatical lconverion of spell unit target to destination target (this is only used in script casts). Closes #2761.

This commit is contained in:
QAston
2011-08-26 16:30:56 +02:00
parent 79427354aa
commit 751cbaf307

View File

@@ -667,10 +667,10 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
if (neededTargets & TARGET_FLAG_DEST_LOCATION)
{
// and target isn't set
if (!targets.GetDst())
if (!m_targets.HasDst())
{
// try to use unit target if provided
if (Unit* target = targets.GetUnitTarget())
if (WorldObject* target = targets.GetObjectTarget())
m_targets.SetDst(*target);
// or use self if not available
else
@@ -682,7 +682,7 @@ void Spell::InitExplicitTargets(SpellCastTargets const& targets)
if (neededTargets & TARGET_FLAG_SOURCE_LOCATION)
{
if (!targets.GetSrc())
if (!targets.HasSrc())
m_targets.SetSrc(*m_caster);
}
else