aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.dev@gmail.com>2011-01-02 17:22:45 +0100
committerShauren <shauren.dev@gmail.com>2011-01-02 17:22:45 +0100
commita3eff12b3319def4f25a6203953aa75f09af7a54 (patch)
tree3455b767124a9b03ae4b206d3ce1614bf9dcb3a8 /src
parenteec299e6051af807836809c3b90d788425d29844 (diff)
Core/Auras: Fixed transform aura stacking logic
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp4
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp12
2 files changed, 10 insertions, 6 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 58c21183982..b35ba61eb2f 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -14225,10 +14225,10 @@ void Unit::RestoreDisplayId()
{
if (AuraApplication const * aurApp = (*i)->GetBase()->GetApplicationOfTarget(GetGUID()))
{
- if (aurApp->IsPositive())
+ if (!handledAura)
handledAura = (*i);
// prefer negative auras
- else
+ if (!aurApp->IsPositive())
{
handledAura = (*i);
break;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 28d3fea7bec..5f646153fad 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3253,7 +3253,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
if (apply)
{
// update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
- if ((!target->getTransForm() && !target->GetShapeshiftForm()) || !IsPositiveSpell(GetId()) || IsPositiveSpell(target->getTransForm()))
+ if (!target->GetModelForForm(target->GetShapeshiftForm()) || !IsPositiveSpell(GetId()))
{
// special case (spell specific functionality)
if (GetMiscValue() == 0)
@@ -3264,7 +3264,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
case 16739:
{
uint32 orb_model = target->GetNativeDisplayId();
- switch(orb_model)
+ switch (orb_model)
{
// Troll Female
case 1479: target->SetDisplayId(10134); break;
@@ -3343,9 +3343,12 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314);
}
}
- target->setTransForm(GetId());
}
+ // update active transform spell only when transform or shapeshift not set or not overwriting negative by positive case
+ if (!target->getTransForm() || !IsPositiveSpell(GetId()) || IsPositiveSpell(target->getTransForm()))
+ target->setTransForm(GetId());
+
// polymorph case
if ((mode & AURA_EFFECT_HANDLE_REAL) && target->GetTypeId() == TYPEID_PLAYER && target->IsPolymorphed())
{
@@ -3362,7 +3365,8 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
else
{
// HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true) will reapply it if need
- target->setTransForm(0);
+ if (target->getTransForm() == GetId())
+ target->setTransForm(0);
target->RestoreDisplayId();