[7967] Removed unused field. Author: tomrus88

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-06 20:22:14 -05:00
parent 54d3b86ffa
commit 1c1ead52dd
3 changed files with 28 additions and 20 deletions
+14 -4
View File
@@ -51,14 +51,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();
}
@@ -163,11 +167,15 @@ bool Corpse::LoadFromDB(uint32 guid, QueryResult *result, uint32 InstanceId)
if(!LoadFromDB(guid, fields))
{
if (!external) delete result;
if (!external)
delete result;
return false;
}
if (!external) delete result;
if (!external)
delete result;
return true;
}
@@ -191,11 +199,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();
+1 -2
View File
@@ -98,7 +98,6 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
m_radius = radius;
m_effIndex = effIndex;
m_spellId = spellId;
m_casterGuid = caster->GetGUID();
m_updateTimer = 0;
return true;
}
@@ -106,7 +105,7 @@ bool DynamicObject::Create( uint32 guidlow, Unit *caster, uint32 spellId, uint32
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)
+1 -2
View File
@@ -41,7 +41,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
GridReference<DynamicObject> &GetGridRef() { return m_gridRef; }
protected:
uint64 m_casterGuid;
uint32 m_spellId;
uint32 m_effIndex;
int32 m_aliveDuration;