[10671] Convert some Unit owner/etc guids to ObjectGuid way.

This commit is contained in:
VladimirMangos 2010-11-01 12:11:23 +03:00
parent 92d98b9fb2
commit a32d68febd
18 changed files with 154 additions and 149 deletions

View file

@ -814,7 +814,7 @@ void AreaAura::Update(uint32 diff)
else if( m_areaAuraType == AREA_AURA_PARTY) // check if in same sub group
{
// not check group if target == owner or target == pet
if (caster->GetCharmerOrOwnerGUID() != target->GetGUID() && caster->GetGUID() != target->GetCharmerOrOwnerGUID())
if (caster->GetCharmerOrOwnerGuid() != target->GetObjectGuid() && caster->GetObjectGuid() != target->GetCharmerOrOwnerGuid())
{
Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself();
@ -832,7 +832,7 @@ void AreaAura::Update(uint32 diff)
else if( m_areaAuraType == AREA_AURA_RAID) // TODO: fix me!
{
// not check group if target == owner or target == pet
if (caster->GetCharmerOrOwnerGUID() != target->GetGUID() && caster->GetGUID() != target->GetCharmerOrOwnerGUID())
if (caster->GetCharmerOrOwnerGuid() != target->GetObjectGuid() && caster->GetObjectGuid() != target->GetCharmerOrOwnerGuid())
{
Player* check = caster->GetCharmerOrOwnerPlayerOrPlayerItself();
@ -847,9 +847,9 @@ void AreaAura::Update(uint32 diff)
target->RemoveSingleAuraFromSpellAuraHolder(GetId(), GetEffIndex(), GetCasterGUID());
}
}
else if( m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER )
else if (m_areaAuraType == AREA_AURA_PET || m_areaAuraType == AREA_AURA_OWNER)
{
if( target->GetGUID() != caster->GetCharmerOrOwnerGUID() )
if (target->GetObjectGuid() != caster->GetCharmerOrOwnerGuid())
target->RemoveSingleAuraFromSpellAuraHolder(GetId(), GetEffIndex(), GetCasterGUID());
}
}
@ -3425,7 +3425,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
target->addUnitState(UNIT_STAT_CONTROLLED);
target->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
target->SetCharmerGUID(p_caster->GetGUID());
target->SetCharmerGuid(p_caster->GetObjectGuid());
target->setFaction(p_caster->getFaction());
// target should became visible at SetView call(if not visible before):
@ -3484,7 +3484,7 @@ void Aura::HandleModPossess(bool apply, bool Real)
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
target->SetCharmerGUID(0);
target->SetCharmerGuid(ObjectGuid());
if(target->GetTypeId() == TYPEID_PLAYER)
{
@ -3603,13 +3603,13 @@ void Aura::HandleModCharm(bool apply, bool Real)
if( apply )
{
if (target->GetCharmerGUID())
if (!target->GetCharmerGuid().IsEmpty())
{
target->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
target->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
}
target->SetCharmerGUID(GetCasterGUID());
target->SetCharmerGuid(GetCasterGuid());
target->setFaction(caster->getFaction());
target->CastStop(target == caster ? GetId() : 0);
caster->SetCharm(target);
@ -3654,7 +3654,7 @@ void Aura::HandleModCharm(bool apply, bool Real)
}
else
{
target->SetCharmerGUID(0);
target->SetCharmerGuid(ObjectGuid());
if(target->GetTypeId() == TYPEID_PLAYER)
((Player*)target)->setFactionForRace(target->getRace());