diff options
| author | Spp <spp@jorge.gr> | 2013-01-30 08:39:06 +0100 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2013-01-30 08:39:06 +0100 |
| commit | fa5dd4bd4e58c13229bcfb8e6bf879838de47e60 (patch) | |
| tree | 45a12345e332e0f1099330fb2fe9e55026c084fb /src/server/game/Spells | |
| parent | 02814975732f8e919d33ff8f2cbaf98f13e04f91 (diff) | |
Core/Misc: Remove some calls to const_cast
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 20 | ||||
| -rw-r--r-- | src/server/game/Spells/Auras/SpellAuras.cpp | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 9230c46db15..05119af2582 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -488,7 +488,7 @@ int32 AuraEffect::CalculateAmount(Unit* caster) break; } - GetBase()->CallScriptEffectCalcAmountHandlers(const_cast<AuraEffect const*>(this), amount, m_canBeRecalculated); + GetBase()->CallScriptEffectCalcAmountHandlers(this, amount, m_canBeRecalculated); amount *= GetBase()->GetStackAmount(); return amount; } @@ -522,7 +522,7 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load) break; } - GetBase()->CallScriptEffectCalcPeriodicHandlers(const_cast<AuraEffect const*>(this), m_isPeriodic, m_amplitude); + GetBase()->CallScriptEffectCalcPeriodicHandlers(this, m_isPeriodic, m_amplitude); if (!m_isPeriodic) return; @@ -598,7 +598,7 @@ void AuraEffect::CalculateSpellMod() default: break; } - GetBase()->CallScriptEffectCalcSpellModHandlers(const_cast<AuraEffect const*>(this), m_spellmod); + GetBase()->CallScriptEffectCalcSpellModHandlers(this, m_spellmod); } void AuraEffect::ChangeAmount(int32 newAmount, bool mark, bool onStackOrReapply) @@ -657,15 +657,15 @@ void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply) // call scripts helping/replacing effect handlers bool prevented = false; if (apply) - prevented = GetBase()->CallScriptEffectApplyHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode); + prevented = GetBase()->CallScriptEffectApplyHandlers(this, aurApp, (AuraEffectHandleModes)mode); else - prevented = GetBase()->CallScriptEffectRemoveHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode); + prevented = GetBase()->CallScriptEffectRemoveHandlers(this, 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()])(const_cast<AuraApplication const*>(aurApp), mode, apply); + (*this.*AuraEffectHandler[GetAuraType()])(aurApp, mode, apply); // check if script events have removed the aura or if default effect prevention was requested if (apply && aurApp->GetRemoveMode()) @@ -673,9 +673,9 @@ void AuraEffect::HandleEffect(AuraApplication * aurApp, uint8 mode, bool apply) // call scripts triggering additional events after apply/remove if (apply) - GetBase()->CallScriptAfterEffectApplyHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode); + GetBase()->CallScriptAfterEffectApplyHandlers(this, aurApp, (AuraEffectHandleModes)mode); else - GetBase()->CallScriptAfterEffectRemoveHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), (AuraEffectHandleModes)mode); + GetBase()->CallScriptAfterEffectRemoveHandlers(this, aurApp, (AuraEffectHandleModes)mode); } void AuraEffect::HandleEffect(Unit* target, uint8 mode, bool apply) @@ -980,7 +980,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - bool prevented = GetBase()->CallScriptEffectProcHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), eventInfo); + bool prevented = GetBase()->CallScriptEffectProcHandlers(this, aurApp, eventInfo); if (prevented) return; @@ -1005,7 +1005,7 @@ void AuraEffect::HandleProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) break; } - GetBase()->CallScriptAfterEffectProcHandlers(const_cast<AuraEffect const*>(this), const_cast<AuraApplication const*>(aurApp), eventInfo); + GetBase()->CallScriptAfterEffectProcHandlers(this, aurApp, eventInfo); } void AuraEffect::CleanupTriggeredSpells(Unit* target) diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 795908ce4b5..4500152133e 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -2048,14 +2048,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - CallScriptProcHandlers(const_cast<AuraApplication const*>(aurApp), eventInfo); + CallScriptProcHandlers(aurApp, eventInfo); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (aurApp->HasEffect(i)) // OnEffectProc / AfterEffectProc hooks handled in AuraEffect::HandleProc() GetEffect(i)->HandleProc(aurApp, eventInfo); - CallScriptAfterProcHandlers(const_cast<AuraApplication const*>(aurApp), eventInfo); + CallScriptAfterProcHandlers(aurApp, eventInfo); // Remove aura if we've used last charge to proc if (IsUsingCharges() && !GetCharges()) |
