From 3c0b80dada2b3353eae26e3a4eebbba0a533f746 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 2 Dec 2010 08:11:32 +0300 Subject: [PATCH] [10814] Convert to ObjectGuid aura cast item guid access function. --- src/game/SpellAuras.h | 4 ++-- src/game/SpellEffects.cpp | 2 +- src/game/UnitAuraProcHandler.cpp | 28 ++++++++++++++-------------- src/shared/revision_nr.h | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 271457bed..c549f445a 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -375,9 +375,9 @@ class MANGOS_DLL_SPEC Aura SpellEntry const* GetSpellProto() const { return GetHolder()->GetSpellProto(); } uint32 GetId() const{ return GetHolder()->GetSpellProto()->Id; } - uint64 GetCastItemGUID() const { return GetHolder()->GetCastItemGuid().GetRawValue(); } + ObjectGuid const& GetCastItemGuid() const { return GetHolder()->GetCastItemGuid(); } uint64 const& GetCasterGUID() const { return GetHolder()->GetCasterGUID(); }//can't be easy replaced by GetCasterGuid until AuraHolders backporting ig we don't want create additional problems for this. - ObjectGuid GetCasterGuid() const { return GetHolder()->GetCasterGuid(); } + ObjectGuid const& GetCasterGuid() const { return GetHolder()->GetCasterGuid(); } Unit* GetCaster() const { return GetHolder()->GetCaster(); } Unit* GetTarget() const { return GetHolder()->GetTarget(); } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3a22c1af3..fb81b2daf 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2492,7 +2492,7 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx) { if ((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN && ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000200000)) && - (*itr)->GetCastItemGUID() == item->GetGUID()) + (*itr)->GetCastItemGuid() == item->GetObjectGuid()) { m_damage += m_damage * damage / 100; return; diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp index 7506ec861..ae1989a22 100644 --- a/src/game/UnitAuraProcHandler.cpp +++ b/src/game/UnitAuraProcHandler.cpp @@ -437,8 +437,8 @@ SpellAuraProcResult Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, Aura { SpellEntry const *hasteSpell = triggeredByAura->GetSpellProto(); - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; uint32 triggered_spell_id = 0; Unit* target = pVictim; @@ -503,8 +503,8 @@ SpellAuraProcResult Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /* SpellEntry const *triggeredByAuraSpell = triggeredByAura->GetSpellProto(); - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; uint32 triggered_spell_id = 0; Unit* target = pVictim; @@ -567,8 +567,8 @@ SpellAuraProcResult Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura SpellEffectIndex effIndex = triggeredByAura->GetEffIndex(); int32 triggerAmount = triggeredByAura->GetModifier()->m_amount; - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; // some dummy spells have trigger spell in spell data already (from 3.0.3) uint32 triggered_spell_id = dummySpell->EffectApplyAuraName[effIndex] == SPELL_AURA_DUMMY ? dummySpell->EffectTriggerSpell[effIndex] : 0; @@ -2695,8 +2695,8 @@ SpellAuraProcResult Unit::HandleProcTriggerSpellAuraProc(Unit *pVictim, uint32 d if(triggeredByAura->GetModifier()->m_auraname == SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE) basepoints[0] = triggerAmount; - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; // Try handle unknown trigger spells // Custom requirements (not listed in procEx) Warning! damage dealing after this @@ -3504,8 +3504,8 @@ SpellAuraProcResult Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint3 if(!pVictim || !pVictim->isAlive()) return SPELL_AURA_PROC_FAILED; - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; // Basepoints of trigger aura int32 triggerAmount = triggeredByAura->GetModifier()->m_amount; @@ -3704,8 +3704,8 @@ SpellAuraProcResult Unit::HandleMaelstromWeaponAuraProc(Unit* /*pVictim*/, uint3 SpellAuraProcResult Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 /*cooldown*/) { SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; switch(spellInfo->SpellFamilyName) { @@ -3749,8 +3749,8 @@ SpellAuraProcResult Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 SpellAuraProcResult Unit::HandleModDamagePercentDoneAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Aura* triggeredByAura, SpellEntry const *procSpell, uint32 /*procFlag*/, uint32 procEx, uint32 cooldown) { SpellEntry const *spellInfo = triggeredByAura->GetSpellProto(); - Item* castItem = triggeredByAura->GetCastItemGUID() && GetTypeId()==TYPEID_PLAYER - ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGUID()) : NULL; + Item* castItem = !triggeredByAura->GetCastItemGuid().IsEmpty() && GetTypeId()==TYPEID_PLAYER + ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetCastItemGuid()) : NULL; // Aspect of the Viper if (spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER && spellInfo->SpellFamilyFlags & UI64LIT(0x4000000000000)) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 58d2fe710..84ecf51ec 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10813" + #define REVISION_NR "10814" #endif // __REVISION_NR_H__