mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/Auras: Fix *nix build
This commit is contained in:
@@ -400,7 +400,7 @@ void AuraEffect::GetTargetList(std::list<Unit *> & targetList) const
|
||||
}
|
||||
}
|
||||
|
||||
void AuraEffect::GetApplicationList(std::list<AuraApplication* const> & applicationList) const
|
||||
void AuraEffect::GetApplicationList(std::list<AuraApplication*> & applicationList) const
|
||||
{
|
||||
Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
|
||||
// remove all targets which were not added to new list - they no longer deserve area aura
|
||||
@@ -951,10 +951,10 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
|
||||
if (!handleMask)
|
||||
return;
|
||||
|
||||
std::list<AuraApplication* const> effectApplications;
|
||||
std::list<AuraApplication*> effectApplications;
|
||||
GetApplicationList(effectApplications);
|
||||
|
||||
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||
HandleEffect(*apptItr, handleMask, false);
|
||||
|
||||
@@ -967,12 +967,12 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
|
||||
CalculateSpellMod();
|
||||
}
|
||||
|
||||
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||
HandleEffect(*apptItr, handleMask, true);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply)
|
||||
void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply)
|
||||
{
|
||||
// check if call is correct, we really don't want using bitmasks here (with 1 exception)
|
||||
ASSERT(!mode
|
||||
@@ -995,15 +995,15 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
|
||||
// call scripts helping/replacing effect handlers
|
||||
bool prevented = false;
|
||||
if (apply)
|
||||
prevented = GetBase()->CallScriptEffectApplyHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
||||
prevented = GetBase()->CallScriptEffectApplyHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
||||
else
|
||||
prevented = GetBase()->CallScriptEffectRemoveHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
||||
prevented = GetBase()->CallScriptEffectRemoveHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
||||
|
||||
// check if script events have removed the aura or if default effect prevention was requested
|
||||
if ((apply && aurApp->GetRemoveMode()) || prevented)
|
||||
return;
|
||||
|
||||
(*this.*AuraEffectHandler [GetAuraType()])(aurApp, mode, apply);
|
||||
(*this.*AuraEffectHandler [GetAuraType()])(const_cast<AuraApplication const *>(aurApp), mode, apply);
|
||||
|
||||
// check if script events have removed the aura or if default effect prevention was requested
|
||||
if (apply && aurApp->GetRemoveMode())
|
||||
@@ -1011,14 +1011,14 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
|
||||
|
||||
// call scripts triggering additional events after apply/remove
|
||||
if (apply)
|
||||
GetBase()->CallScriptAfterEffectApplyHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
||||
GetBase()->CallScriptAfterEffectApplyHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
||||
else
|
||||
GetBase()->CallScriptAfterEffectRemoveHandlers(const_cast<AuraEffect const *>(this), aurApp, (AuraEffectHandleModes)mode);
|
||||
GetBase()->CallScriptAfterEffectRemoveHandlers(const_cast<AuraEffect const *>(this), const_cast<AuraApplication const *>(aurApp), (AuraEffectHandleModes)mode);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleEffect(Unit * target, uint8 mode, bool apply)
|
||||
{
|
||||
AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
AuraApplication * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||
ASSERT(aurApp);
|
||||
HandleEffect(aurApp, mode, apply);
|
||||
}
|
||||
@@ -1096,10 +1096,10 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
|
||||
m_periodicTimer += m_amplitude - diff;
|
||||
UpdatePeriodic(caster);
|
||||
|
||||
std::list<AuraApplication* const> effectApplications;
|
||||
std::list<AuraApplication*> effectApplications;
|
||||
GetApplicationList(effectApplications);
|
||||
// tick on targets of effects
|
||||
for (std::list<AuraApplication* const>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
for (std::list<AuraApplication*>::const_iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
|
||||
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||
PeriodicTick(*apptItr, caster);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class AuraEffect
|
||||
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
||||
Aura * GetBase() const { return m_base; }
|
||||
void GetTargetList(std::list<Unit*> & targetList) const;
|
||||
void GetApplicationList(std::list<AuraApplication* const> & applicationList) const;
|
||||
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
|
||||
|
||||
SpellEntry const * GetSpellProto() const { return m_spellProto; }
|
||||
uint32 GetId() const { return m_spellProto->Id; }
|
||||
@@ -49,7 +49,7 @@ class AuraEffect
|
||||
void RecalculateAmount(Unit * caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
||||
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
||||
void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
|
||||
void HandleEffect(AuraApplication const * aurApp, uint8 mode, bool apply);
|
||||
void HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
void HandleEffect(Unit * target, uint8 mode, bool apply);
|
||||
void ApplySpellMod(Unit * target, bool apply);
|
||||
|
||||
|
||||
@@ -876,7 +876,7 @@ void Aura::RecalculateAmountOfEffects()
|
||||
m_effects[i]->RecalculateAmount(caster);
|
||||
}
|
||||
|
||||
void Aura::HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply)
|
||||
void Aura::HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply)
|
||||
{
|
||||
ASSERT (!IsRemoved());
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
|
||||
@@ -155,7 +155,7 @@ class Aura
|
||||
AuraEffect * GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; }
|
||||
uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1<<i; return effMask; }
|
||||
void RecalculateAmountOfEffects();
|
||||
void HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply);
|
||||
void HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||
|
||||
// Helpers for targets
|
||||
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
||||
|
||||
Reference in New Issue
Block a user