diff options
author | Shauren <shauren.trinity@gmail.com> | 2012-08-15 18:27:50 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2012-08-15 18:27:50 +0200 |
commit | 0e304fa98c8d3a9724ed7d908da2ba2bbeef5958 (patch) | |
tree | 345706e5104ebd64394ef39b7977c66e8f6eefef /src | |
parent | c29eb1f87a5de18de6cd8a39376ce5d6a7a9fda0 (diff) |
Core/Spells: Updated mount cast check
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index b2543432ded..16409b94ffe 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -363,7 +363,7 @@ bool SpellEffectInfo::IsAura() const bool SpellEffectInfo::IsAura(AuraType aura) const { - return IsAura() && ApplyAuraName == aura; + return IsAura() && AuraType(ApplyAuraName) == aura; } bool SpellEffectInfo::IsTargetingArea() const @@ -1486,17 +1486,27 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a } // aura limitations - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (player) { - if (!Effects[i].IsAura()) - continue; - switch (Effects[i].ApplyAuraName) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - case SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED: - case SPELL_AURA_FLY: + if (!Effects[i].IsAura()) + continue; + + switch (Effects[i].ApplyAuraName) { - if (player && !player->IsKnowHowFlyIn(map_id, zone_id)) - return SPELL_FAILED_INCORRECT_AREA; + case SPELL_AURA_FLY: + { + if (!player->IsKnowHowFlyIn(map_id, zone_id)) + return SPELL_FAILED_INCORRECT_AREA; + break; + } + case SPELL_AURA_MOUNTED: + { + if (Effects[i].MiscValueB && !player->GetMountCapability(Effects[i].MiscValueB)) + return SPELL_FAILED_NOT_HERE; + break; + } } } } |