diff --git a/src/common/Utilities/EnumClassFlag.h b/src/common/Utilities/EnumClassFlag.h
deleted file mode 100644
index c6f597cc10..0000000000
--- a/src/common/Utilities/EnumClassFlag.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see .
- */
-
-#ifndef EnumClassFlag_h__
-#define EnumClassFlag_h__
-
-#include
-
-template
-class EnumClassFlag
-{
- static_assert(std::is_enum::value, "EnumClassFlag must be used only with enums");
-
-public:
- /*implicit*/ EnumClassFlag(T value) : _value(value) { }
-
- EnumClassFlag& operator&=(EnumClassFlag right)
- {
- _value = static_cast(static_cast>(_value) & static_cast>(right._value));
- return *this;
- }
-
- friend EnumClassFlag operator&(EnumClassFlag left, EnumClassFlag right)
- {
- return left &= right;
- }
-
- EnumClassFlag operator|=(EnumClassFlag right)
- {
- _value = static_cast(static_cast>(_value) | static_cast>(right._value));
- return *this;
- }
-
- friend EnumClassFlag operator|(EnumClassFlag left, EnumClassFlag right)
- {
- return left |= right;
- }
-
- EnumClassFlag operator~() const
- {
- return static_cast(~static_cast>(_value));
- }
-
- void RemoveFlag(EnumClassFlag flag)
- {
- _value = static_cast(static_cast>(_value) & ~static_cast>(flag._value));
- }
-
- bool HasFlag(T flag) const
- {
- return (static_cast>(_value) & static_cast>(flag)) != 0;
- }
-
- operator T() const
- {
- return _value;
- }
-
- std::underlying_type_t AsUnderlyingType() const
- {
- return static_cast>(_value);
- }
-
-private:
- T _value;
-};
-
-#endif // EnumClassFlag_h__
diff --git a/src/common/Utilities/EnumFlag.h b/src/common/Utilities/EnumFlag.h
new file mode 100644
index 0000000000..0665ec7bb0
--- /dev/null
+++ b/src/common/Utilities/EnumFlag.h
@@ -0,0 +1,138 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see .
+ */
+
+#ifndef EnumFlag_h__
+#define EnumFlag_h__
+
+#include
+
+template
+constexpr bool IsEnumFlag(T) { return false; }
+
+#define DEFINE_ENUM_FLAG(enumType) constexpr bool IsEnumFlag(enumType) { return true; }
+
+namespace EnumTraits
+{
+ template
+ using IsFlag = std::integral_constant ;
+}
+
+template::value, std::nullptr_t> = nullptr>
+inline constexpr T operator&(T left, T right)
+{
+ return static_cast(static_cast>(left) & static_cast>(right));
+}
+
+template::value, std::nullptr_t> = nullptr>
+inline constexpr T& operator&=(T& left, T right)
+{
+ return left = left & right;
+}
+
+template::value, std::nullptr_t> = nullptr>
+inline constexpr T operator|(T left, T right)
+{
+ return static_cast(static_cast>(left) | static_cast>(right));
+}
+
+template::value, std::nullptr_t> = nullptr>
+inline constexpr T& operator|=(T& left, T right)
+{
+ return left = left | right;
+}
+
+template::value, std::nullptr_t> = nullptr>
+inline constexpr T operator~(T value)
+{
+ return static_cast(~static_cast>(value));
+}
+
+template
+class EnumFlag
+{
+
+ static_assert(EnumTraits::IsFlag::value, "EnumFlag must be used only with enums that are specify EnumFlag::IsFlag");
+
+public:
+ using underlying_type = std::underlying_type_t;
+
+ /*implicit*/ constexpr EnumFlag(T value) : _value(value)
+ {
+ }
+
+ constexpr EnumFlag& operator&=(EnumFlag right)
+ {
+ _value &= right._value;
+ return *this;
+ }
+
+ constexpr friend EnumFlag operator&(EnumFlag left, EnumFlag right)
+ {
+ return left &= right;
+ }
+
+ constexpr EnumFlag& operator|=(EnumFlag right)
+ {
+ _value |= right._value;
+ return *this;
+ }
+
+ constexpr friend EnumFlag operator|(EnumFlag left, EnumFlag right)
+ {
+ return left |= right;
+ }
+
+ constexpr EnumFlag operator~() const
+ {
+ return static_cast(~static_cast>(_value));
+ }
+
+ constexpr void RemoveFlag(EnumFlag flag)
+ {
+ _value &= ~flag._value;
+ }
+
+ constexpr bool HasFlag(T flag) const
+ {
+ return static_cast(_value & flag) != static_cast(0);
+ }
+
+ constexpr bool HasAllFlags(T flags) const
+ {
+ return (_value & flags) == flags;
+ }
+
+ constexpr bool HasAnyFlag() const
+ {
+ return static_cast(_value) != underlying_type{};
+ }
+
+ constexpr operator T() const
+ {
+ return _value;
+ }
+
+ constexpr underlying_type AsUnderlyingType() const
+ {
+ return static_cast(_value);
+ }
+
+private:
+ T _value;
+};
+
+#endif // EnumFlag_h__
diff --git a/src/server/game/AI/PlayerAI/PlayerAI.cpp b/src/server/game/AI/PlayerAI/PlayerAI.cpp
index 5fbb205268..71f6458afa 100644
--- a/src/server/game/AI/PlayerAI/PlayerAI.cpp
+++ b/src/server/game/AI/PlayerAI/PlayerAI.cpp
@@ -691,7 +691,7 @@ void PlayerAI::CancelAllShapeshifts()
}
for (Aura* aura : removableShapeshifts)
- me->RemoveOwnedAura(aura, AURA_REMOVE_BY_CANCEL);
+ me->RemoveOwnedAura(aura, AuraRemoveFlags::ByCancel);
}
Unit* PlayerAI::SelectAttackTarget() const
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 8e927f7ca0..84a2f0bfc5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -886,7 +886,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (e.action.removeAura.charges)
{
if (Aura* aur = target->ToUnit()->GetAura(e.action.removeAura.spell))
- aur->ModCharges(-static_cast(e.action.removeAura.charges), AURA_REMOVE_BY_EXPIRE);
+ aur->ModCharges(-static_cast(e.action.removeAura.charges), AuraRemoveFlags::Expired);
}
else
target->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell);
diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
index ddb872b514..531f9135dc 100644
--- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp
+++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp
@@ -252,7 +252,7 @@ void DynamicObject::RemoveAura()
_removedAura = _aura;
_aura = nullptr;
if (!_removedAura->IsRemoved())
- _removedAura->_Remove(AURA_REMOVE_BY_DEFAULT);
+ _removedAura->_Remove(AuraRemoveFlags::ByDefault);
}
void DynamicObject::SetCasterViewpoint()
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 8b6ea97a55..8c480a8876 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -1920,7 +1920,7 @@ void Unit::CalcAbsorbResist(DamageInfo& damageInfo)
absorbAurEff->SetAmount(absorbAurEff->GetAmount() - currentAbsorb);
// Aura cannot absorb anything more - remove it
if (absorbAurEff->GetAmount() <= 0)
- absorbAurEff->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL);
+ absorbAurEff->GetBase()->Remove(AuraRemoveFlags::ByEnemySpell);
}
}
@@ -1977,7 +1977,7 @@ void Unit::CalcAbsorbResist(DamageInfo& damageInfo)
{
absorbAurEff->SetAmount(absorbAurEff->GetAmount() - currentAbsorb);
if ((absorbAurEff->GetAmount() <= 0))
- absorbAurEff->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL);
+ absorbAurEff->GetBase()->Remove(AuraRemoveFlags::ByEnemySpell);
}
}
@@ -2100,7 +2100,7 @@ void Unit::CalcHealAbsorb(HealInfo& healInfo) const
if (auraEff->GetAmount() <= 0)
{
uint32 removedAuras = healInfo.GetTarget()->m_removedAurasCount;
- auraEff->GetBase()->Remove(AURA_REMOVE_BY_ENEMY_SPELL);
+ auraEff->GetBase()->Remove(AuraRemoveFlags::ByEnemySpell);
if (removedAuras + 1 < healInfo.GetTarget()->m_removedAurasCount)
i = vHealAbsorb.begin();
}
@@ -3053,7 +3053,7 @@ void Unit::_UpdateSpells(uint32 time)
for (AuraMap::iterator i = m_ownedAuras.begin(); i != m_ownedAuras.end();)
{
if (i->second->IsExpired())
- RemoveOwnedAura(i, AURA_REMOVE_BY_EXPIRE);
+ RemoveOwnedAura(i, AuraRemoveFlags::Expired);
else
++i;
}
@@ -3139,7 +3139,7 @@ void Unit::SetCurrentCastSpell(Spell* pSpell)
return;
// break same type spell if it is not delayed
- InterruptSpell(CSpellType, false);
+ InterruptSpell(CSpellType, false, true, pSpell);
// special breakage effects:
switch (CSpellType)
@@ -3205,7 +3205,7 @@ void Unit::SetCurrentCastSpell(Spell* pSpell)
pSpell->m_selfContainer = &(m_currentSpells[pSpell->GetCurrentContainer()]);
}
-void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant)
+void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant, Spell* interruptingSpell /* = nullptr */)
{
//TC_LOG_DEBUG("entities.unit", "Interrupt spell for unit %u.", GetEntry());
Spell* spell = m_currentSpells[spellType];
@@ -3225,7 +3225,7 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
m_currentSpells[spellType] = nullptr;
if (spell->getState() != SPELL_STATE_FINISHED)
- spell->cancel();
+ spell->cancel(interruptingSpell);
if (GetTypeId() == TYPEID_UNIT && IsAIEnabled)
ToCreature()->AI()->OnSpellCastFinished(spell->GetSpellInfo(), SPELL_FINISHED_CANCELED);
@@ -3276,19 +3276,19 @@ bool Unit::IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled, bool skipAu
return false;
}
-void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withInstant)
+void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withInstant /* = true */, Spell* interruptingSpell /* = nullptr */)
{
// generic spells are interrupted if they are not finished or delayed
if (m_currentSpells[CURRENT_GENERIC_SPELL] && (!spell_id || m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == spell_id))
- InterruptSpell(CURRENT_GENERIC_SPELL, withDelayed, withInstant);
+ InterruptSpell(CURRENT_GENERIC_SPELL, withDelayed, withInstant, interruptingSpell);
// autorepeat spells are interrupted if they are not finished or delayed
if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && (!spell_id || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == spell_id))
- InterruptSpell(CURRENT_AUTOREPEAT_SPELL, withDelayed, withInstant);
+ InterruptSpell(CURRENT_AUTOREPEAT_SPELL, withDelayed, withInstant, interruptingSpell);
// channeled spells are interrupted if they are not finished, even if they are delayed
if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id == spell_id))
- InterruptSpell(CURRENT_CHANNELED_SPELL, true, true);
+ InterruptSpell(CURRENT_CHANNELED_SPELL, true, true, interruptingSpell);
}
Spell* Unit::FindCurrentSpellBySpellId(uint32 spell_id) const
@@ -3389,7 +3389,7 @@ void Unit::DeMorph()
SetDisplayId(GetNativeDisplayId());
}
-Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/, bool resetPeriodicTimer /*= true*/)
+Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount /*= nullptr*/, Item* castItem /*= nullptr*/, ObjectGuid casterGUID /*= ObjectGuid::Empty*/)
{
ASSERT(casterGUID || caster);
@@ -3438,7 +3438,7 @@ Aura* Unit::_TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8
}
// try to increase stack amount
- foundAura->ModStackAmount(1, AURA_REMOVE_BY_DEFAULT, resetPeriodicTimer);
+ foundAura->ModStackAmount(1, AuraRemoveFlags::ByDefault);
return foundAura;
}
}
@@ -3556,14 +3556,14 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
_RemoveNoStackAurasDueToAura(aura);
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
return;
// Update target aura state flag
if (AuraStateType aState = aura->GetSpellInfo()->GetAuraState())
ModifyAuraState(aState, true);
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
return;
// Sitdown on apply aura req seated
@@ -3572,7 +3572,7 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
Unit* caster = aura->GetCaster();
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
return;
aura->HandleAuraSpecificMods(aurApp, caster, true, false);
@@ -3580,7 +3580,7 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
// apply effects of the aura
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (effMask & 1 << i && (!aurApp->GetRemoveMode()))
+ if (effMask & 1 << i && !aurApp->GetRemoveMode().HasAnyFlag())
aurApp->_HandleEffect(i, true);
}
@@ -3590,16 +3590,16 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
}
// removes aura application from lists and unapplies effects
-void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
+void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveFlags removeMode)
{
AuraApplication * aurApp = i->second;
ASSERT(aurApp);
- ASSERT(!aurApp->GetRemoveMode());
+ ASSERT(!aurApp->GetRemoveMode().HasAnyFlag());
ASSERT(aurApp->GetTarget() == this);
aurApp->SetRemoveMode(removeMode);
Aura* aura = aurApp->GetBase();
- TC_LOG_DEBUG("spells", "Aura %u now is remove mode %d", aura->GetId(), removeMode);
+ TC_LOG_DEBUG("spells", "Aura %u now is remove mode %u", aura->GetId(), static_cast(removeMode));
// dead loop is killing the server probably
ASSERT(m_removedAurasCount < 0xFFFFFFFF);
@@ -3651,7 +3651,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
ASSERT(!aurApp->GetEffectMask());
// Remove totem at next update if totem loses its aura
- if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && IsTotem())
+ if (aurApp->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired) && GetTypeId() == TYPEID_UNIT && IsTotem())
{
if (ToTotem()->GetSpell() == aura->GetId() && ToTotem()->GetTotemType() == TOTEM_PASSIVE)
ToTotem()->setDeathState(JUST_DIED);
@@ -3672,7 +3672,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
i = m_appliedAuras.begin();
}
-void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
+void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveFlags removeMode)
{
// aura can be removed from unit only if it's applied on it, shouldn't happen
ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
@@ -3726,7 +3726,7 @@ void Unit::_RemoveNoStackAurasDueToAura(Aura* aura)
if (aura->CanStackWith(i->second->GetBase()))
continue;
- RemoveAura(i, AURA_REMOVE_BY_DEFAULT);
+ RemoveAura(i, AuraRemoveFlags::ByDefault);
if (i == m_appliedAuras.end())
break;
remove = true;
@@ -3742,7 +3742,7 @@ void Unit::_RegisterAuraEffect(AuraEffect* aurEff, bool apply)
}
// All aura base removes should go threw this function!
-void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode)
+void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveFlags removeMode)
{
Aura* aura = i->second;
ASSERT(!aura->IsRemoved());
@@ -3763,7 +3763,7 @@ void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode)
i = m_ownedAuras.begin();
}
-void Unit::RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID, uint8 reqEffMask, AuraRemoveMode removeMode)
+void Unit::RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID, uint8 reqEffMask, AuraRemoveFlags removeMode)
{
for (AuraMap::iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId);)
if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
@@ -3775,16 +3775,16 @@ void Unit::RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID, uint8 reqEffMa
++itr;
}
-void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode)
+void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveFlags removeMode)
{
if (aura->IsRemoved())
return;
ASSERT(aura->GetOwner() == this);
- if (removeMode == AURA_REMOVE_NONE)
+ if (removeMode == AuraRemoveFlags::None)
{
- TC_LOG_ERROR("spells", "Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId %u", aura->GetId());
+ TC_LOG_ERROR("spells", "Unit::RemoveOwnedAura() called with unallowed removeMode AuraRemoveFlags::None, spellId %u", aura->GetId());
return;
}
@@ -3819,12 +3819,13 @@ Aura* Unit::GetOwnedAura(uint32 spellId, ObjectGuid casterGUID, ObjectGuid itemC
return nullptr;
}
-void Unit::RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode)
+void Unit::RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveFlags mode)
{
AuraApplication * aurApp = i->second;
// Do not remove aura which is already being removed
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
return;
+
Aura* aura = aurApp->GetBase();
_UnapplyAura(i, mode);
// Remove aura - for Area and Target auras
@@ -3832,7 +3833,7 @@ void Unit::RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode)
aura->Remove(mode);
}
-void Unit::RemoveAura(uint32 spellId, ObjectGuid caster, uint8 reqEffMask, AuraRemoveMode removeMode)
+void Unit::RemoveAura(uint32 spellId, ObjectGuid caster, uint8 reqEffMask, AuraRemoveFlags removeMode)
{
AuraApplicationMapBoundsNonConst range = m_appliedAuras.equal_range(spellId);
for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
@@ -3849,13 +3850,13 @@ void Unit::RemoveAura(uint32 spellId, ObjectGuid caster, uint8 reqEffMask, AuraR
}
}
-void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode)
+void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveFlags mode)
{
// we've special situation here, RemoveAura called while during aura removal
// this kind of call is needed only when aura effect removal handler
// or event triggered by it expects to remove
// not yet removed effects of an aura
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
{
// remove remaining effects of an aura
for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr)
@@ -3884,7 +3885,7 @@ void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode)
}
}
-void Unit::RemoveAura(Aura* aura, AuraRemoveMode mode)
+void Unit::RemoveAura(Aura* aura, AuraRemoveFlags mode)
{
if (aura->IsRemoved())
return;
@@ -3963,7 +3964,7 @@ void Unit::RemoveAurasByType(AuraType auraType, std::functionCallScriptDispel(&dispelInfo);
if (aura->GetSpellInfo()->HasAttribute(SPELL_ATTR7_DISPEL_CHARGES))
- aura->ModCharges(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModCharges(-dispelInfo.GetRemovedCharges(), AuraRemoveFlags::ByEnemySpell);
else
- aura->ModStackAmount(-dispelInfo.GetRemovedCharges(), AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModStackAmount(-dispelInfo.GetRemovedCharges(), AuraRemoveFlags::ByEnemySpell);
// Call AfterDispel hook on AuraScript
aura->CallScriptAfterDispel(&dispelInfo);
@@ -4089,9 +4090,9 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, U
}
if (stealCharge)
- aura->ModCharges(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModCharges(-1, AuraRemoveFlags::ByEnemySpell);
else
- aura->ModStackAmount(-1, AURA_REMOVE_BY_ENEMY_SPELL);
+ aura->ModStackAmount(-1, AuraRemoveFlags::ByEnemySpell);
return;
}
@@ -4197,7 +4198,7 @@ void Unit::RemoveNotOwnLimitedTargetAuras(bool onPhaseChange /*= false*/)
}
}
-void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
+void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except, Spell* interruptingSpell /* = nullptr */)
{
if (!(m_interruptMask & flag))
return;
@@ -4223,7 +4224,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
&& (spell->m_spellInfo->ChannelInterruptFlags & flag)
&& spell->m_spellInfo->Id != except
&& !(flag & AURA_INTERRUPT_FLAG_MOVE && HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, spell->GetSpellInfo())))
- InterruptNonMeleeSpells(false);
+ InterruptNonMeleeSpells(false, 0, true, interruptingSpell);
UpdateInterruptMask();
}
@@ -4251,7 +4252,7 @@ void Unit::RemoveMovementImpairingAuras()
RemoveAurasWithMechanic((1<second->GetBase();
if (!aura->IsPassive() && !aura->IsDeathPersistent())
- _UnapplyAura(iter, AURA_REMOVE_BY_DEATH);
+ _UnapplyAura(iter, AuraRemoveFlags::ByDeath);
else
++iter;
}
@@ -4358,7 +4359,7 @@ void Unit::RemoveAllAurasOnDeath()
{
Aura* aura = iter->second;
if (!aura->IsPassive() && !aura->IsDeathPersistent())
- RemoveOwnedAura(iter, AURA_REMOVE_BY_DEATH);
+ RemoveOwnedAura(iter, AuraRemoveFlags::ByDeath);
else
++iter;
}
@@ -4370,7 +4371,7 @@ void Unit::RemoveAllAurasRequiringDeadTarget()
{
Aura const* aura = iter->second->GetBase();
if (!aura->IsPassive() && aura->GetSpellInfo()->IsRequiringDeadTarget())
- _UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
+ _UnapplyAura(iter, AuraRemoveFlags::ByDefault);
else
++iter;
}
@@ -4379,7 +4380,7 @@ void Unit::RemoveAllAurasRequiringDeadTarget()
{
Aura* aura = iter->second;
if (!aura->IsPassive() && aura->GetSpellInfo()->IsRequiringDeadTarget())
- RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
+ RemoveOwnedAura(iter, AuraRemoveFlags::ByDefault);
else
++iter;
}
@@ -4393,7 +4394,7 @@ void Unit::RemoveAllAurasExceptType(AuraType type)
if (aura->GetSpellInfo()->HasAura(type))
++iter;
else
- _UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
+ _UnapplyAura(iter, AuraRemoveFlags::ByDefault);
}
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
@@ -4402,7 +4403,7 @@ void Unit::RemoveAllAurasExceptType(AuraType type)
if (aura->GetSpellInfo()->HasAura(type))
++iter;
else
- RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
+ RemoveOwnedAura(iter, AuraRemoveFlags::ByDefault);
}
}
@@ -4414,7 +4415,7 @@ void Unit::RemoveAllAurasExceptType(AuraType type1, AuraType type2)
if (aura->GetSpellInfo()->HasAura(type1) || aura->GetSpellInfo()->HasAura(type2))
++iter;
else
- _UnapplyAura(iter, AURA_REMOVE_BY_DEFAULT);
+ _UnapplyAura(iter, AuraRemoveFlags::ByDefault);
}
for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
@@ -4423,7 +4424,7 @@ void Unit::RemoveAllAurasExceptType(AuraType type1, AuraType type2)
if (aura->GetSpellInfo()->HasAura(type1) || aura->GetSpellInfo()->HasAura(type2))
++iter;
else
- RemoveOwnedAura(iter, AURA_REMOVE_BY_DEFAULT);
+ RemoveOwnedAura(iter, AuraRemoveFlags::ByDefault);
}
}
@@ -6430,10 +6431,10 @@ Unit* Unit::GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo)
// Set up missile speed based delay
uint32 delay = uint32(std::floor(std::max(victim->GetDistance(this), 5.0f) / spellInfo->Speed * 1000.0f));
// Schedule charge drop
- (*itr)->GetBase()->DropChargeDelayed(delay, AURA_REMOVE_BY_EXPIRE);
+ (*itr)->GetBase()->DropChargeDelayed(delay, AuraRemoveFlags::Expired);
}
else
- (*itr)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE);
+ (*itr)->GetBase()->DropCharge(AuraRemoveFlags::Expired);
return magnet;
}
@@ -6452,7 +6453,7 @@ Unit* Unit::GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo)
&& spellInfo->CheckTarget(this, magnet, false) == SPELL_CAST_OK)))
if (roll_chance_i((*i)->GetAmount()))
{
- (*i)->GetBase()->DropCharge(AURA_REMOVE_BY_EXPIRE);
+ (*i)->GetBase()->DropCharge(AuraRemoveFlags::Expired);
return magnet;
}
}
@@ -9521,23 +9522,6 @@ int32 Unit::CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto
return spellProto->Effects[effect_index].CalcValue(this, basePoints, target);
}
-int32 Unit::CalcSpellDuration(SpellInfo const* spellProto)
-{
- uint8 comboPoints = m_playerMovingMe ? m_playerMovingMe->GetComboPoints() : 0;
-
- int32 minduration = spellProto->GetDuration();
- int32 maxduration = spellProto->GetMaxDuration();
-
- int32 duration;
-
- if (comboPoints && minduration != -1 && minduration != maxduration)
- duration = minduration + int32((maxduration - minduration) * comboPoints / 5);
- else
- duration = minduration;
-
- return duration;
-}
-
int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask)
{
// don't mod permanent auras duration
@@ -11046,7 +11030,7 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc
uint8 procEffectMask;
std::tie(procEffectMask, aurApp) = aurAppProc;
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
continue;
SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo();
@@ -12298,7 +12282,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// charm is set by aura, and aura effect remove handler was called during apply handler execution
// prevent undefined behaviour
- if (aurApp && aurApp->GetRemoveMode())
+ if (aurApp && aurApp->GetRemoveMode().HasAnyFlag())
return false;
_oldFactionId = GetFaction();
@@ -12333,7 +12317,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
// charm is set by aura, and aura effect remove handler was called during apply handler execution
// prevent undefined behaviour
- if (aurApp && aurApp->GetRemoveMode())
+ if (aurApp && aurApp->GetRemoveMode().HasAnyFlag())
return false;
// Pets already have a properly initialized CharmInfo, don't overwrite it.
@@ -13513,7 +13497,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
}
}
- if (aurApp->GetRemoveMode())
+ if (aurApp->GetRemoveMode().HasAnyFlag())
return;
if (Player* player = ToPlayer())
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index feb22ac332..110da9c64d 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -330,7 +330,7 @@ enum TriggerCastFlags : uint32
TRIGGERED_IGNORE_BLOCKED_SPELL_FAMILY = 0x00004000, //! Will ignore blocked casts of SPELL_AURA_BLOCK_SPELL_FAMILY
// reuse = 0x00008000,
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
- TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
+ // reuse = 0x00020000,
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
TRIGGERED_FULL_MASK = 0x0007FFFF, //! Used when doing CastSpell with triggered == true
@@ -1450,13 +1450,13 @@ class TC_GAME_API Unit : public WorldObject
bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
// aura apply/remove helpers - you should better not use these
- Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty, bool resetPeriodicTimer = true);
+ Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = nullptr, Item* castItem = nullptr, ObjectGuid casterGUID = ObjectGuid::Empty);
void _AddAura(UnitAura* aura, Unit* caster);
AuraApplication * _CreateAuraApplication(Aura* aura, uint8 effMask);
void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
void _ApplyAura(AuraApplication * aurApp, uint8 effMask);
- void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
- void _UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode);
+ void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveFlags removeMode);
+ void _UnapplyAura(AuraApplication * aurApp, AuraRemoveFlags removeMode);
void _RemoveNoStackAurasDueToAura(Aura* aura);
void _RegisterAuraEffect(AuraEffect* aurEff, bool apply);
@@ -1464,9 +1464,9 @@ class TC_GAME_API Unit : public WorldObject
AuraMap & GetOwnedAuras() { return m_ownedAuras; }
AuraMap const& GetOwnedAuras() const { return m_ownedAuras; }
- void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- void RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
+ void RemoveOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
+ void RemoveOwnedAura(Aura* aura, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
Aura* GetOwnedAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, ObjectGuid itemCasterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, Aura* except = nullptr) const;
@@ -1474,10 +1474,10 @@ class TC_GAME_API Unit : public WorldObject
AuraApplicationMap & GetAppliedAuras() { return m_appliedAuras; }
AuraApplicationMap const& GetAppliedAuras() const { return m_appliedAuras; }
- void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAura(Aura* aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveFlags mode = AuraRemoveFlags::ByDefault);
+ void RemoveAura(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
+ void RemoveAura(AuraApplication * aurApp, AuraRemoveFlags mode = AuraRemoveFlags::ByDefault);
+ void RemoveAura(Aura* aur, AuraRemoveFlags mode = AuraRemoveFlags::ByDefault);
// Convenience methods removing auras by predicate
void RemoveAppliedAuras(std::function const& check);
@@ -1489,17 +1489,17 @@ class TC_GAME_API Unit : public WorldObject
void RemoveAurasByType(AuraType auraType, std::function const& check);
- void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
- void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, uint8 reqEffMask = 0, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
+ void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty, AuraRemoveFlags removeMode = AuraRemoveFlags::ByDefault);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, Unit* stealer);
void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid);
void RemoveAurasByType(AuraType auraType, ObjectGuid casterGUID = ObjectGuid::Empty, Aura* except = nullptr, bool negative = true, bool positive = true);
void RemoveNotOwnLimitedTargetAuras(bool onPhaseChange = false);
- void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
+ void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0, Spell* interruptingSpell = nullptr);
void RemoveAurasWithAttribute(uint32 flags);
void RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, ObjectGuid casterGUID);
- void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode = AURA_REMOVE_BY_DEFAULT, uint32 except = 0);
+ void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveFlags removemode = AuraRemoveFlags::ByDefault, uint32 except = 0);
void RemoveMovementImpairingAuras();
void RemoveAreaAurasDueToLeaveWorld();
@@ -1596,7 +1596,7 @@ class TC_GAME_API Unit : public WorldObject
void SetChannelObjectGuid(ObjectGuid guid) { SetGuidValue(UNIT_FIELD_CHANNEL_OBJECT, guid); }
void SetCurrentCastSpell(Spell* pSpell);
- void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true);
+ void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed = true, bool withInstant = true, Spell* interruptingSpell = nullptr);
void FinishSpell(CurrentSpellTypes spellType, bool ok = true);
// set withDelayed to true to account delayed spells as cast
@@ -1606,7 +1606,7 @@ class TC_GAME_API Unit : public WorldObject
// set withDelayed to true to interrupt delayed spells too
// delayed+channeled spells are always interrupted
- void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0, bool withInstant = true);
+ void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0, bool withInstant = true, Spell* interruptingSpell = nullptr);
Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; }
Spell* GetCurrentSpell(uint32 spellType) const { return m_currentSpells[spellType]; }
@@ -1788,7 +1788,6 @@ class TC_GAME_API Unit : public WorldObject
float ApplyEffectModifiers(SpellInfo const* spellProto, uint8 effect_index, float value) const;
int32 CalculateSpellDamage(Unit const* target, SpellInfo const* spellProto, uint8 effect_index, int32 const* basePoints = nullptr) const;
- int32 CalcSpellDuration(SpellInfo const* spellProto);
int32 ModSpellDuration(SpellInfo const* spellProto, Unit const* target, int32 duration, bool positive, uint32 effectMask);
void ModSpellCastTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = nullptr);
void ModSpellDurationTime(SpellInfo const* spellProto, int32& castTime, Spell* spell = nullptr);
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index fe14a8d106..8c9d595cf6 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -831,7 +831,7 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
ASSERT(itr != vehicleAuras.end());
AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(Target->GetBase()->GetGUID());
- ASSERT(aurApp && !aurApp->GetRemoveMode());
+ ASSERT(aurApp && !aurApp->GetRemoveMode().HasAnyFlag());
Target->RemovePendingEventsForSeat(Seat->first);
Target->RemovePendingEventsForPassenger(Passenger);
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp
index 7923e4d837..bdd5bec68c 100644
--- a/src/server/game/Handlers/SpellHandler.cpp
+++ b/src/server/game/Handlers/SpellHandler.cpp
@@ -511,7 +511,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
return;
// maybe should only remove one buff when there are multiple?
- _player->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
+ _player->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AuraRemoveFlags::ByCancel);
// If spell being removed is a resource tracker, see if player was tracking both (herbs / minerals) and remove the other
if (sWorld->getBoolConfig(CONFIG_ALLOW_TRACK_BOTH_RESOURCES) && spellInfo->HasAura(SPELL_AURA_TRACK_RESOURCES))
@@ -528,7 +528,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket)
// Remove all auras related to resource tracking (only Herbs and Minerals in 3.3.5a)
for (std::list::iterator it = spellIDs.begin(); it != spellIDs.end(); ++it)
- _player->RemoveOwnedAura(*it, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
+ _player->RemoveOwnedAura(*it, ObjectGuid::Empty, 0, AuraRemoveFlags::ByCancel);
}
}
}
@@ -567,7 +567,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket)
return;
}
- pet->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AURA_REMOVE_BY_CANCEL);
+ pet->RemoveOwnedAura(spellId, ObjectGuid::Empty, 0, AuraRemoveFlags::ByCancel);
}
void WorldSession::HandleCancelGrowthAuraOpcode(WorldPacket& /*recvPacket*/) { }
diff --git a/src/server/game/Phasing/PhaseShift.cpp b/src/server/game/Phasing/PhaseShift.cpp
index d5791b1dbc..773a65f1df 100644
--- a/src/server/game/Phasing/PhaseShift.cpp
+++ b/src/server/game/Phasing/PhaseShift.cpp
@@ -89,7 +89,7 @@ void PhaseShift::Clear()
void PhaseShift::ClearPhases()
{
- Flags &= EnumClassFlag(PhaseShiftFlags::AlwaysVisible) | PhaseShiftFlags::Inverse;
+ Flags &= EnumFlag(PhaseShiftFlags::AlwaysVisible) | PhaseShiftFlags::Inverse;
Phases.clear();
NonCosmeticReferences = 0;
CosmeticReferences = 0;
@@ -161,7 +161,7 @@ void PhaseShift::ModifyPhasesReferences(PhaseContainer::iterator itr, int32 refe
if (CosmeticReferences)
Flags |= PhaseShiftFlags::NoCosmetic;
else
- Flags &= ~EnumClassFlag(PhaseShiftFlags::NoCosmetic);
+ Flags &= ~EnumFlag(PhaseShiftFlags::NoCosmetic);
UpdateUnphasedFlag();
}
@@ -169,8 +169,8 @@ void PhaseShift::ModifyPhasesReferences(PhaseContainer::iterator itr, int32 refe
void PhaseShift::UpdateUnphasedFlag()
{
- EnumClassFlag unphasedFlag = !Flags.HasFlag(PhaseShiftFlags::Inverse) ? PhaseShiftFlags::Unphased : PhaseShiftFlags::InverseUnphased;
- Flags &= ~EnumClassFlag(!Flags.HasFlag(PhaseShiftFlags::Inverse) ? PhaseShiftFlags::InverseUnphased : PhaseShiftFlags::Unphased);
+ EnumFlag unphasedFlag = !Flags.HasFlag(PhaseShiftFlags::Inverse) ? PhaseShiftFlags::Unphased : PhaseShiftFlags::InverseUnphased;
+ Flags &= ~EnumFlag(!Flags.HasFlag(PhaseShiftFlags::Inverse) ? PhaseShiftFlags::InverseUnphased : PhaseShiftFlags::Unphased);
if (NonCosmeticReferences && !DefaultReferences)
Flags &= ~unphasedFlag;
else
diff --git a/src/server/game/Phasing/PhaseShift.h b/src/server/game/Phasing/PhaseShift.h
index c30b477c9a..0fadbcc42d 100644
--- a/src/server/game/Phasing/PhaseShift.h
+++ b/src/server/game/Phasing/PhaseShift.h
@@ -19,7 +19,7 @@
#define PhaseShift_h__
#include "Define.h"
-#include "EnumClassFlag.h"
+#include "EnumFlag.h"
#include "ObjectGuid.h"
#include
#include