diff options
author | Subv <s.v.h21@hotmail.com> | 2012-04-14 14:07:31 -0500 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-04-14 14:51:59 -0500 |
commit | 8c3d0e23689f8cbe4f4d7381dd9ebe9a905adfa8 (patch) | |
tree | 4f567456d65f7c5b32d77152cfb1deb6240c0bfc /src | |
parent | 06278fe7fb2698fa3ff62eec3e84baebcb62a4ce (diff) |
Core/Spells: Dont remove auras on stance change if the stance you are moving to is also allowed by the spell.
Closes #2758
Signed-off-by: Subv <s.v.h21@hotmail.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index a1bb14b3e16..dbbd89c7533 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -1600,10 +1600,25 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const } } + const Unit::AuraEffectList& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT); + AuraEffect* newAura = NULL; + // Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied + for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr) + { + if ((*itr) != this) + { + newAura = *itr; + break; + } + } Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras(); for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();) { - if (itr->second->GetBase()->IsRemovedOnShapeLost(target)) + // Use the new aura to see on what stance the target will be + uint32 newStance = (1<<((newAura ? newAura->GetMiscValue() : 0)-1)); + + // If the stances are not compatible with the spell, remove it + if (itr->second->GetBase()->IsRemovedOnShapeLost(target) && !(itr->second->GetBase()->GetSpellInfo()->Stances & newStance)) target->RemoveAura(itr); else ++itr; |