Removed unused field.

This commit is contained in:
tomrus88 2009-06-05 16:12:01 +04:00
parent b96643b8df
commit 944a211016
3 changed files with 36 additions and 24 deletions

View file

@ -49,14 +49,18 @@ Corpse::~Corpse()
void Corpse::AddToWorld()
{
///- Register the corpse for guid lookup
if(!IsInWorld()) ObjectAccessor::Instance().AddObject(this);
if(!IsInWorld())
ObjectAccessor::Instance().AddObject(this);
Object::AddToWorld();
}
void Corpse::RemoveFromWorld()
{
///- Remove the corpse from the accessor
if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this);
if(IsInWorld())
ObjectAccessor::Instance().RemoveObject(this);
Object::RemoveFromWorld();
}
@ -157,11 +161,15 @@ bool Corpse::LoadFromDB(uint32 guid, QueryResult *result)
if(!LoadFromDB(guid, fields))
{
if (!external) delete result;
if (!external)
delete result;
return false;
}
if (!external) delete result;
if (!external)
delete result;
return true;
}
@ -185,11 +193,13 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
m_time = time_t(fields[6].GetUInt64());
m_type = CorpseType(fields[7].GetUInt32());
if(m_type >= MAX_CORPSE_TYPE)
{
sLog.outError("Corpse (guidlow %d, owner %d) have wrong corpse type, not load.",GetGUIDLow(),GUID_LOPART(GetOwnerGUID()));
return false;
}
uint32 instanceid = fields[8].GetUInt32();
uint32 phaseMask = fields[9].GetUInt32();

View file

@ -39,14 +39,18 @@ DynamicObject::DynamicObject() : WorldObject()
void DynamicObject::AddToWorld()
{
///- Register the dynamicObject for guid lookup
if(!IsInWorld()) ObjectAccessor::Instance().AddObject(this);
if(!IsInWorld())
ObjectAccessor::Instance().AddObject(this);
Object::AddToWorld();
}
void DynamicObject::RemoveFromWorld()
{
///- Remove the dynamicObject from the accessor
if(IsInWorld()) ObjectAccessor::Instance().RemoveObject(this);
if(IsInWorld())
ObjectAccessor::Instance().RemoveObject(this);
Object::RemoveFromWorld();
}
@ -78,14 +82,13 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
m_radius = radius;
m_effIndex = effIndex;
m_spellId = spellId;
m_casterGuid = caster->GetGUID();
return true;
}
Unit* DynamicObject::GetCaster() const
{
// can be not found in some cases
return ObjectAccessor::GetUnit(*this,m_casterGuid);
return ObjectAccessor::GetUnit(*this, GetCasterGUID());
}
void DynamicObject::Update(uint32 p_time)

View file

@ -39,7 +39,7 @@ class DynamicObject : public WorldObject
uint32 GetSpellId() const { return m_spellId; }
uint32 GetEffIndex() const { return m_effIndex; }
uint32 GetDuration() const { return m_aliveDuration; }
uint64 GetCasterGUID() const { return m_casterGuid; }
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
Unit* GetCaster() const;
float GetRadius() const { return m_radius; }
bool IsAffecting(Unit *unit) const { return m_affected.find(unit) != m_affected.end(); }
@ -58,7 +58,6 @@ class DynamicObject : public WorldObject
bool isActiveObject() const { return false; }
protected:
uint64 m_casterGuid;
uint32 m_spellId;
uint32 m_effIndex;
int32 m_aliveDuration;