aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrista <aconstantgoal@abv.bg>2012-12-22 04:27:02 +0200
committerTrista <aconstantgoal@abv.bg>2012-12-22 04:28:31 +0200
commit80dcf879deb61198ff2c91d71887f0eae9acad68 (patch)
treeae5ee9b443fd47c1d9b339ccf59e75bc7a452daa /src
parenta3b34e2894e19c3e5939b7c74e49302046a88b0c (diff)
Core/Spells: TARGET_UNIT_MASTER passenger support
* what happened before was spells casted from vehicle to passenger getting blocked by general check exceptions that state passengers to be not implicitly spell hit, however they should be ignored when caster is vehicle to master passenger * fix a lot of quests that award kill credit that was blocked before * precisely closes: #8643 and makes #5254 awardable
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellInfo.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index fcfa441455e..6631a8138b4 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -1546,11 +1546,18 @@ 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 and some or all* spells,
+ // the use of these 2 covers passenger target check
+ if (!(Targets & TARGET_UNIT_MASTER) && !caster->IsVehicle())
+ {
+ 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;