Core: Get rid of dirty operator workaround for ACE_Singleton class implementation

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-22 21:25:23 +01:00
parent 0948fc5bbe
commit 0f3b9019a8
159 changed files with 1943 additions and 1939 deletions
@@ -650,7 +650,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster)
amount += int32(caster->ApplyEffectModifiers(m_spellProto, m_effIndex, mwb));
// "If used while your target is above 75% health, Rend does 35% more damage."
// as for 3.1.3 only ranks above 9 (wrong tooltip?)
if (sSpellMgr.GetSpellRank(m_spellProto->Id) >= 9)
if (sSpellMgr->GetSpellRank(m_spellProto->Id) >= 9)
{
if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellProto, caster))
AddPctN(amount, SpellMgr::CalculateSpellEffectAmount(m_spellProto, 2, caster));
@@ -1025,7 +1025,7 @@ void AuraEffect::ApplySpellMod(Unit * target, bool apply)
Aura * aura = iter->second->GetBase();
// only passive auras-active auras should have amount set on spellcast and not be affected
// if aura is casted by others, it will not be affected
if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr.IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
if ((aura->IsPassive() || aura->GetSpellProto()->AttributesEx2 & SPELL_ATTR2_ALWAYS_APPLY_MODIFIERS) && aura->GetCasterGUID() == guid && sSpellMgr->IsAffectedByMod(aura->GetSpellProto(), m_spellmod))
{
if (GetMiscValue() == SPELLMOD_ALL_EFFECTS)
{
@@ -2418,7 +2418,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
else
{
Creature* c = triggerTarget->ToCreature();
if (!c || (c && !sScriptMgr.OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) ||
if (!c || (c && !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) ||
(c && !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()))))
sLog.outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex());
}
@@ -2959,7 +2959,7 @@ void AuraEffect::HandlePhase(AuraApplication const * aurApp, uint8 mode, bool ap
{
newPhase = PHASEMASK_NORMAL;
if (Creature* creature = target->ToCreature())
if (CreatureData const* data = sObjectMgr.GetCreatureData(creature->GetDBTableGUIDLow()))
if (CreatureData const* data = sObjectMgr->GetCreatureData(creature->GetDBTableGUIDLow()))
newPhase = data->phaseMask;
}
@@ -3340,8 +3340,8 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode,
if (target->GetTypeId() == TYPEID_PLAYER)
team = target->ToPlayer()->GetTeam();
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr->ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@@ -3789,8 +3789,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b
if (target->GetTypeId() == TYPEID_PLAYER)
team = target->ToPlayer()->GetTeam();
uint32 display_id = sObjectMgr.ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr->ChooseDisplayId(team,ci);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@@ -4420,7 +4420,7 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const * aurApp, uin
bg->EventPlayerDroppedFlag(target->ToPlayer());
}
else
sOutdoorPvPMgr.HandleDropFlag((Player*)target,GetSpellProto()->Id);
sOutdoorPvPMgr->HandleDropFlag((Player*)target,GetSpellProto()->Id);
}
}
@@ -6098,8 +6098,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
if (target->GetTypeId() == TYPEID_PLAYER)
team = target->ToPlayer()->GetTeam();
uint32 display_id = sObjectMgr.ChooseDisplayId(team, creatureInfo);
CreatureModelInfo const *minfo = sObjectMgr.GetCreatureModelRandomGender(display_id);
uint32 display_id = sObjectMgr->ChooseDisplayId(team, creatureInfo);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(display_id);
if (minfo)
display_id = minfo->modelid;
@@ -6200,7 +6200,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo
if (mode & AURA_EFFECT_HANDLE_REAL)
{
// pet auras
if (PetAura const* petSpell = sSpellMgr.GetPetAura(GetId(), m_effIndex))
if (PetAura const* petSpell = sSpellMgr->GetPetAura(GetId(), m_effIndex))
{
if (apply)
target->AddPetAura(petSpell);
+8 -8
View File
@@ -527,7 +527,7 @@ void Aura::UpdateTargetMap(Unit * caster, bool apply)
for (Unit::AuraApplicationMap::iterator iter = itr->first->GetAppliedAuras().begin(); iter != itr->first->GetAppliedAuras().end(); ++iter)
{
Aura const * aura = iter->second->GetBase();
if (!sSpellMgr.CanAurasStack(this, aura, aura->GetCasterGUID() == GetCasterGUID()))
if (!sSpellMgr->CanAurasStack(this, aura, aura->GetCasterGUID() == GetCasterGUID()))
{
addUnit = false;
break;
@@ -863,7 +863,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
Unit * target = aurApp->GetTarget();
AuraRemoveMode removeMode = aurApp->GetRemoveMode();
// spell_area table
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAuraMapBounds(GetId());
SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAuraMapBounds(GetId());
if (saBounds.first != saBounds.second)
{
uint32 zone, area;
@@ -886,9 +886,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
if (apply)
{
// Apply linked auras (On first aura apply)
if (sSpellMgr.GetSpellCustomAttr(GetId()) & SPELL_ATTR0_CU_LINK_AURA)
if (sSpellMgr->GetSpellCustomAttr(GetId()) & SPELL_ATTR0_CU_LINK_AURA)
{
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
if (*itr < 0)
@@ -1090,11 +1090,11 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
// Remove Linked Auras
if (removeMode != AURA_REMOVE_BY_STACK && removeMode != AURA_REMOVE_BY_DEATH)
{
if (uint32 customAttr = sSpellMgr.GetSpellCustomAttr(GetId()))
if (uint32 customAttr = sSpellMgr->GetSpellCustomAttr(GetId()))
{
if (customAttr & SPELL_ATTR0_CU_LINK_REMOVE)
{
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(-(int32)GetId()))
if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(-(int32)GetId()))
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
if (*itr < 0)
@@ -1105,7 +1105,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
}
if (customAttr & SPELL_ATTR0_CU_LINK_AURA)
{
if (const std::vector<int32> *spell_triggered = sSpellMgr.GetSpellLinked(GetId() + SPELL_LINK_AURA))
if (const std::vector<int32> *spell_triggered = sSpellMgr->GetSpellLinked(GetId() + SPELL_LINK_AURA))
for (std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
{
if (*itr < 0)
@@ -1634,7 +1634,7 @@ void Aura::_DeleteRemovedApplications()
void Aura::LoadScripts()
{
sLog.outDebug("Aura::LoadScripts");
sScriptMgr.CreateAuraScripts(m_spellProto->Id, m_loadedScripts);
sScriptMgr->CreateAuraScripts(m_spellProto->Id, m_loadedScripts);
for(std::list<AuraScript *>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
{
if (!(*itr)->_Load(this))