[10750] Convert Gameobject owner to objectguid use.

This commit is contained in:
VladimirMangos 2010-11-19 21:35:32 +03:00
parent 6154cb3b43
commit bbd34562a8
4 changed files with 9 additions and 9 deletions

View file

@ -73,7 +73,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellE
SetEntry(spellId);
SetObjectScale(DEFAULT_OBJECT_SCALE);
SetUInt64Value(DYNAMICOBJECT_CASTER, caster->GetGUID());
SetGuidValue(DYNAMICOBJECT_CASTER, caster->GetObjectGuid());
/* Bytes field, so it's really 4 bit fields. These flags are unknown, but we do know that 0x00000001 is set for most.
Farsight for example, does not have this flag, instead it has 0x80000002.
@ -103,7 +103,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, SpellE
Unit* DynamicObject::GetCaster() const
{
// can be not found in some cases
return ObjectAccessor::GetUnit(*this, GetCasterGUID());
return ObjectAccessor::GetUnit(*this, GetCasterGuid());
}
void DynamicObject::Update(uint32 p_time)
@ -152,7 +152,7 @@ void DynamicObject::Delay(int32 delaytime)
Unit *target = GetMap()->GetUnit((*iter));
if (target)
{
SpellAuraHolder *holder = target->GetSpellAuraHolder(m_spellId, GetCasterGUID());
SpellAuraHolder *holder = target->GetSpellAuraHolder(m_spellId, GetCasterGuid().GetRawValue());
if (!holder)
{
++iter;
@ -175,7 +175,7 @@ void DynamicObject::Delay(int32 delaytime)
continue;
}
target->DelaySpellAuraHolder(m_spellId, delaytime, GetCasterGUID());
target->DelaySpellAuraHolder(m_spellId, delaytime, GetCasterGuid().GetRawValue());
++iter;
}
else
@ -189,7 +189,7 @@ bool DynamicObject::isVisibleForInState(Player const* u, WorldObject const* view
return false;
// always seen by owner
if(GetCasterGUID()==u->GetGUID())
if (GetCasterGuid() == u->GetObjectGuid())
return true;
// normal case

View file

@ -40,7 +40,7 @@ class DynamicObject : public WorldObject
uint32 GetSpellId() const { return m_spellId; }
SpellEffectIndex GetEffIndex() const { return m_effIndex; }
uint32 GetDuration() const { return m_aliveDuration; }
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
ObjectGuid const& GetCasterGuid() const { return GetGuidValue(DYNAMICOBJECT_CASTER); }
Unit* GetCaster() const;
float GetRadius() const { return m_radius; }
bool IsAffecting(Unit *unit) const { return m_affected.find(unit->GetObjectGuid()) != m_affected.end(); }

View file

@ -2078,7 +2078,7 @@ bool WorldObject::IsControlledByPlayer() const
case TYPEID_PLAYER:
return ((Unit*)this)->IsCharmerOrOwnerPlayerOrPlayerItself();
case TYPEID_DYNAMICOBJECT:
return IS_PLAYER_GUID(((DynamicObject*)this)->GetCasterGUID());
return ((DynamicObject*)this)->GetCasterGuid().IsPlayer();
case TYPEID_CORPSE:
return true;
default:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10749"
#define REVISION_NR "10750"
#endif // __REVISION_NR_H__