aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellInfo.cpp
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-12-23 08:33:13 -0500
committerSubv <s.v.h21@hotmail.com>2012-12-23 08:33:13 -0500
commit3869bb7b3a96751b463ecec2d9ac663b792a0703 (patch)
tree330d7e96fa4021f6301d488d64ac6eed717172ab /src/server/game/Spells/SpellInfo.cpp
parentd40cbe0113329de96723e8fe015651c919760a15 (diff)
parent143340b38c857b2cc50ee9f8577abf9248b6317a (diff)
Merge branch 'master' of https://github.com/TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Entities/Item/Item.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Entities/Player/Player.h
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 9b9b888a9f3..e8d0cb6feeb 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1680,11 +1680,21 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT))
return SPELL_FAILED_BAD_TARGETS;
- if (TargetAuraState && !unitTarget->HasAuraState(AuraStateType(TargetAuraState), this, caster))
- return SPELL_FAILED_TARGET_AURASTATE;
+ /* 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;
- if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster))
- return SPELL_FAILED_TARGET_AURASTATE;
+ if (TargetAuraStateNot && unitTarget->HasAuraState(AuraStateType(TargetAuraStateNot), this, caster))
+ return SPELL_FAILED_TARGET_AURASTATE;
+ }
if (TargetAuraSpell && !unitTarget->HasAura(sSpellMgr->GetSpellIdForDifficulty(TargetAuraSpell, caster)))
return SPELL_FAILED_TARGET_AURASTATE;