*Only use m_isWorldObject to check if an object is in grid or world.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-08-11 16:14:45 -05:00
1 parent 4267816fca
commit 9403ff03e7
9 files changed
+30 -94

No files matched your search

+8 -3
View File
@@ -29,6 +29,7 @@
#include "World.h"
Corpse::Corpse(CorpseType type) : WorldObject()
, m_type(type)
{
m_objectType |= TYPEMASK_CORPSE;
m_objectTypeId = TYPEID_CORPSE;
@@ -37,13 +38,14 @@ Corpse::Corpse(CorpseType type) : WorldObject()
m_valuesCount = CORPSE_END;
m_type = type;
m_mapId = 0;
m_time = time(NULL);
lootForBody = false;
if(type != CORPSE_BONES)
m_isWorldObject = true;
}
Corpse::~Corpse()
@@ -203,7 +205,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
SetInstanceId(fields[8].GetUInt32());
m_time = time_t(fields[6].GetUInt64());
m_type = CorpseType(fields[7].GetUInt32());
const_cast<CorpseType>(m_type) = CorpseType(fields[7].GetUInt32());
if(m_type >= MAX_CORPSE_TYPE)
{
@@ -211,6 +213,9 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields)
return false;
}
if(m_type != CORPSE_BONES)
m_isWorldObject = true;
uint32 phaseMask = fields[9].GetUInt32();
// overwrite possible wrong/corrupted guid