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();
|
Aura::ApplicationMap const & targetMap = GetBase()->GetApplicationMap();
|
||||||
// remove all targets which were not added to new list - they no longer deserve area aura
|
// 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)
|
if (!handleMask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::list<AuraApplication* const> effectApplications;
|
std::list<AuraApplication*> effectApplications;
|
||||||
GetApplicationList(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()))
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||||
HandleEffect(*apptItr, handleMask, false);
|
HandleEffect(*apptItr, handleMask, false);
|
||||||
|
|
||||||
@@ -967,12 +967,12 @@ void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply)
|
|||||||
CalculateSpellMod();
|
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()))
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||||
HandleEffect(*apptItr, handleMask, true);
|
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)
|
// check if call is correct, we really don't want using bitmasks here (with 1 exception)
|
||||||
ASSERT(!mode
|
ASSERT(!mode
|
||||||
@@ -995,15 +995,15 @@ void AuraEffect::HandleEffect(AuraApplication const * aurApp, uint8 mode, bool a
|
|||||||
// call scripts helping/replacing effect handlers
|
// call scripts helping/replacing effect handlers
|
||||||
bool prevented = false;
|
bool prevented = false;
|
||||||
if (apply)
|
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
|
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
|
// check if script events have removed the aura or if default effect prevention was requested
|
||||||
if ((apply && aurApp->GetRemoveMode()) || prevented)
|
if ((apply && aurApp->GetRemoveMode()) || prevented)
|
||||||
return;
|
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
|
// check if script events have removed the aura or if default effect prevention was requested
|
||||||
if (apply && aurApp->GetRemoveMode())
|
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
|
// call scripts triggering additional events after apply/remove
|
||||||
if (apply)
|
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
|
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)
|
void AuraEffect::HandleEffect(Unit * target, uint8 mode, bool apply)
|
||||||
{
|
{
|
||||||
AuraApplication const * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
AuraApplication * aurApp = GetBase()->GetApplicationOfTarget(target->GetGUID());
|
||||||
ASSERT(aurApp);
|
ASSERT(aurApp);
|
||||||
HandleEffect(aurApp, mode, apply);
|
HandleEffect(aurApp, mode, apply);
|
||||||
}
|
}
|
||||||
@@ -1096,10 +1096,10 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
|
|||||||
m_periodicTimer += m_amplitude - diff;
|
m_periodicTimer += m_amplitude - diff;
|
||||||
UpdatePeriodic(caster);
|
UpdatePeriodic(caster);
|
||||||
|
|
||||||
std::list<AuraApplication* const> effectApplications;
|
std::list<AuraApplication*> effectApplications;
|
||||||
GetApplicationList(effectApplications);
|
GetApplicationList(effectApplications);
|
||||||
// tick on targets of effects
|
// 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()))
|
if ((*apptItr)->HasEffect(GetEffIndex()))
|
||||||
PeriodicTick(*apptItr, caster);
|
PeriodicTick(*apptItr, caster);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class AuraEffect
|
|||||||
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
uint64 GetCasterGUID() const { return GetBase()->GetCasterGUID(); }
|
||||||
Aura * GetBase() const { return m_base; }
|
Aura * GetBase() const { return m_base; }
|
||||||
void GetTargetList(std::list<Unit*> & targetList) const;
|
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; }
|
SpellEntry const * GetSpellProto() const { return m_spellProto; }
|
||||||
uint32 GetId() const { return m_spellProto->Id; }
|
uint32 GetId() const { return m_spellProto->Id; }
|
||||||
@@ -49,7 +49,7 @@ class AuraEffect
|
|||||||
void RecalculateAmount(Unit * caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
void RecalculateAmount(Unit * caster) { if (!CanBeRecalculated()) return; ChangeAmount(CalculateAmount(caster), false); }
|
||||||
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
bool CanBeRecalculated() const { return m_canBeRecalculated; }
|
||||||
void SetCanBeRecalculated(bool val) { m_canBeRecalculated = val; }
|
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 HandleEffect(Unit * target, uint8 mode, bool apply);
|
||||||
void ApplySpellMod(Unit * target, bool apply);
|
void ApplySpellMod(Unit * target, bool apply);
|
||||||
|
|
||||||
|
|||||||
@@ -876,7 +876,7 @@ void Aura::RecalculateAmountOfEffects()
|
|||||||
m_effects[i]->RecalculateAmount(caster);
|
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());
|
ASSERT (!IsRemoved());
|
||||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
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]; }
|
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; }
|
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 RecalculateAmountOfEffects();
|
||||||
void HandleAllEffects(AuraApplication const * aurApp, uint8 mode, bool apply);
|
void HandleAllEffects(AuraApplication * aurApp, uint8 mode, bool apply);
|
||||||
|
|
||||||
// Helpers for targets
|
// Helpers for targets
|
||||||
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
ApplicationMap const & GetApplicationMap() {return m_applications;}
|
||||||
|
|||||||
Reference in New Issue
Block a user