[10813] Use ObjectGuid for aura holder cast item guid.

Still exist 7 GUID_LOPART uses in code.
This commit is contained in:
VladimirMangos 2010-12-02 07:59:21 +03:00
parent 0a964e43a9
commit 957c9331a9
6 changed files with 15 additions and 15 deletions

View file

@ -971,7 +971,7 @@ void Aura::ReapplyAffectedPassiveAuras( Unit* target, bool owner_mode )
{
// only applied by self or aura caster
if (itr->second->GetCasterGuid() == target->GetObjectGuid())
affectedSelf[itr->second->GetId()] = itr->second->GetCastItemGUID();
affectedSelf[itr->second->GetId()] = itr->second->GetCastItemGuid();
else if (itr->second->GetCasterGuid() == GetCasterGuid())
affectedAuraCaster.insert(itr->second->GetId());
}
@ -7762,7 +7762,7 @@ bool Aura::IsLastAuraOnHolder()
}
SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit *target, WorldObject *caster, Item *castItem) :
m_target(target), m_castItemGuid(castItem?castItem->GetGUID():0),
m_target(target), m_castItemGuid(castItem ? castItem->GetObjectGuid() : ObjectGuid()),
m_auraSlot(MAX_AURAS), m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0),
m_stackAmount(1), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE),
m_permanent(false), m_isRemovedOnShapeLost(true), m_deleted(false), m_in_use(0)
@ -7863,7 +7863,7 @@ void SpellAuraHolder::_AddSpellAuraHolder()
{
if (m_spellProto->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
{
Item* castItem = m_castItemGuid ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
Item* castItem = !m_castItemGuid.IsEmpty() ? ((Player*)caster)->GetItemByGuid(m_castItemGuid) : NULL;
((Player*)caster)->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true);
}
}
@ -8159,7 +8159,7 @@ Unit* SpellAuraHolder::GetCaster() const
bool SpellAuraHolder::IsWeaponBuffCoexistableWith(SpellAuraHolder* ref)
{
// only item casted spells
if (!GetCastItemGUID())
if (GetCastItemGuid().IsEmpty())
return false;
// Exclude Debuffs
@ -8178,7 +8178,7 @@ bool SpellAuraHolder::IsWeaponBuffCoexistableWith(SpellAuraHolder* ref)
if (m_target->GetTypeId() != TYPEID_PLAYER || m_target->GetObjectGuid() != GetCasterGuid())
return false;
Item* castItem = ((Player*)m_target)->GetItemByGuid(GetCastItemGUID());
Item* castItem = ((Player*)m_target)->GetItemByGuid(GetCastItemGuid());
if (!castItem)
return false;
@ -8188,7 +8188,7 @@ bool SpellAuraHolder::IsWeaponBuffCoexistableWith(SpellAuraHolder* ref)
return false;
// form different weapons
return ref->GetCastItemGUID() && ref->GetCastItemGUID() != GetCastItemGUID();
return !ref->GetCastItemGuid().IsEmpty() && ref->GetCastItemGuid() != GetCastItemGuid();
}
bool SpellAuraHolder::IsNeedVisibleSlot(Unit const* caster) const