aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Spell.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 54d138a5e6a..f0738d513d7 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1645,9 +1645,10 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
case SPELL_TARGET_TYPE_GAMEOBJECT:
if(i_spellST->second.targetEntry)
{
- if(goScriptTarget = m_caster->FindNearestGameObject(i_spellST->second.targetEntry, range))
+ if(GameObject *go = m_caster->FindNearestGameObject(i_spellST->second.targetEntry, range))
{
// remember found target and range, next attempt will find more near target with another entry
+ goScriptTarget = go;
creatureScriptTarget = NULL;
range = m_caster->GetDistance(goScriptTarget);
}
@@ -1668,8 +1669,9 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
return m_targets.getUnitTarget();
case SPELL_TARGET_TYPE_DEAD:
default:
- if(creatureScriptTarget = m_caster->FindNearestCreature(i_spellST->second.targetEntry, range, i_spellST->second.type != SPELL_TARGET_TYPE_DEAD))
+ if(Creature *cre = m_caster->FindNearestCreature(i_spellST->second.targetEntry, range, i_spellST->second.type != SPELL_TARGET_TYPE_DEAD))
{
+ creatureScriptTarget = cre;
goScriptTarget = NULL;
range = m_caster->GetDistance(creatureScriptTarget);
}