aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <qaston@gmail.com>2011-09-11 22:40:48 +0200
committerQAston <qaston@gmail.com>2011-09-11 22:42:29 +0200
commit1d38ccaca6c98143e21d78ae2e891d9242c7a48c (patch)
tree04f526443410332b6bcbc5351e0cdac92f38451f /src
parent606fd07cb1b3f8925a4261d5e9f69d5d7331ede3 (diff)
Core/Spells: Remove redundant explicit target checks from Spell::cast
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp22
1 files changed, 4 insertions, 18 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 198e1b7b43f..7414ee9e1f6 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3062,25 +3062,11 @@ void Spell::cast(bool skipCheck)
// update pointers base at GUIDs to prevent access to non-existed already object
UpdatePointers();
- if (Unit* target = m_targets.GetUnitTarget())
+ // cancel at lost explicit target during cast
+ if (m_targets.GetObjectTargetGUID() && !m_targets.GetObjectTarget())
{
- // three check: prepare, cast (m_casttime > 0), hit (delayed)
- if (m_casttime && target->isAlive() && !target->IsFriendlyTo(m_caster) && !m_caster->canSeeOrDetect(target))
- {
- SendCastResult(SPELL_FAILED_BAD_TARGETS);
- SendInterrupted(0);
- finish(false);
- return;
- }
- }
- else
- {
- // cancel at lost main target unit
- if (m_targets.GetUnitTargetGUID() && m_targets.GetUnitTargetGUID() != m_caster->GetGUID())
- {
- cancel();
- return;
- }
+ cancel();
+ return;
}
// now that we've done the basic check, now run the scripts