aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrista <aconstantgoal@abv.bg>2012-12-22 06:32:45 +0200
committerTrista <aconstantgoal@abv.bg>2012-12-22 06:32:45 +0200
commitaabfa3afae128e5cc23852d6b9ddef145c6e360e (patch)
tree2ae764d62c2edf232be744c5e11c94b27eec70f4
parent80dcf879deb61198ff2c91d71887f0eae9acad68 (diff)
Core/Spell: Properly rewrite previous change: 80dcf879deb61198ff2c91d71887f0eae9acad68
* thx to @joschiwald for noticing problem and helping, see rest info in comment or previous fix
-rw-r--r--src/server/game/Spells/SpellInfo.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 6631a8138b4..61b92ce6f81 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1546,11 +1546,14 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT))
return SPELL_FAILED_BAD_TARGETS;
- // TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to
- // not allow passengers to be implicitly hit by spells, however this target type should be an exception,
- // if this is left it kills spells that award kill credit from vehicle to master and some or all* spells,
- // the use of these 2 covers passenger target check
- if (!(Targets & TARGET_UNIT_MASTER) && !caster->IsVehicle())
+ /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to
+ not allow passengers to be implicitly hit by spells, however this target type should be an exception,
+ if this is left it kills spells that award kill credit from vehicle to master (few spells),
+ the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit
+ him, because it would be it's passenger, there's no such case where this gets to fail legitimacy, this problem
+ cannot be solved from within the check in other way since target type cannot be called for the spell currently
+ Spell examples: [ID - 52864 Devour Water, ID - 52862 Devour Wind, ID - 49370 Wyrmrest Defender: Destabilize Azure Dragonshrine Effect] */
+ if (!caster->IsVehicle() && !(caster->GetCharmerOrOwner() == target))
{
if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster))
return SPELL_FAILED_TARGET_AURASTATE;