aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGildor <gildor55@gmail.com>2020-10-08 20:36:50 +0200
committerGitHub <noreply@github.com>2020-10-08 20:36:50 +0200
commitc13ccaab5c70361d3a51005a1ce374291835b39c (patch)
treef2a22b83e867a413f3475e0e4bf9d6f57d3aeb43 /src
parentce2d4413049548ad9e5ed61d09eaa204cf0952fe (diff)
Core/Spells: Aura refresh improvements (#25511)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp7
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h2
-rw-r--r--src/server/game/Spells/Spell.cpp5
3 files changed, 9 insertions, 5 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 0fce2319398..808b291a46c 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -300,7 +300,7 @@ uint8 Aura::BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 available
return effMask & availableEffectMask;
}
-Aura* Aura::TryRefreshStackOrCreate(AuraCreateInfo& createInfo)
+Aura* Aura::TryRefreshStackOrCreate(AuraCreateInfo& createInfo, bool updateEffectMask)
{
ASSERT_NODEBUGINFO(createInfo.Caster || createInfo.CasterGUID);
@@ -331,8 +331,9 @@ Aura* Aura::TryRefreshStackOrCreate(AuraCreateInfo& createInfo)
Unit* unit = createInfo._owner->ToUnit();
// check effmask on owner application (if existing)
- if (AuraApplication* aurApp = foundAura->GetApplicationOfTarget(unit->GetGUID()))
- aurApp->UpdateApplyEffectMask(effMask);
+ if (updateEffectMask)
+ if (AuraApplication* aurApp = foundAura->GetApplicationOfTarget(unit->GetGUID()))
+ aurApp->UpdateApplyEffectMask(effMask);
return foundAura;
}
else
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 5abfcfcf05f..bae8c93729c 100644
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -103,7 +103,7 @@ class TC_GAME_API Aura
typedef std::unordered_map<ObjectGuid, AuraApplication*> ApplicationMap;
static uint8 BuildEffectMaskForOwner(SpellInfo const* spellProto, uint8 availableEffectMask, WorldObject* owner);
- static Aura* TryRefreshStackOrCreate(AuraCreateInfo& createInfo);
+ static Aura* TryRefreshStackOrCreate(AuraCreateInfo& createInfo, bool updateEffectMask = true);
static Aura* TryCreate(AuraCreateInfo& createInfo);
static Aura* Create(AuraCreateInfo& createInfo);
explicit Aura(AuraCreateInfo const& createInfo);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 088b46ea6a4..1e3f9e34cbf 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -2841,7 +2841,7 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
.SetOwnerEffectMask(aura_effmask)
.IsRefresh = &refresh;
- if (Aura* aura = Aura::TryRefreshStackOrCreate(createInfo))
+ if (Aura* aura = Aura::TryRefreshStackOrCreate(createInfo, false))
{
hitInfo.HitAura = aura->ToUnitAura();
@@ -2870,6 +2870,9 @@ void Spell::DoSpellEffectHit(Unit* unit, uint8 effIndex, TargetInfo& hitInfo)
hitInfo.HitAura->SetMaxDuration(hitInfo.AuraDuration);
hitInfo.HitAura->SetDuration(hitInfo.AuraDuration);
}
+
+ if (refresh)
+ hitInfo.HitAura->AddStaticApplication(unit, aura_effmask);
}
}
else