diff options
author | megamage <none@none> | 2009-08-11 16:14:45 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-11 16:14:45 -0500 |
commit | 9403ff03e792154b5709a05d8dfdd7da123ce9b5 (patch) | |
tree | f6072a69420fcb17da553ef3bc5821daee895b3e /src/game/Corpse.cpp | |
parent | 4267816fca55b137bf4c7e4e530816dc5c4e7d43 (diff) |
*Only use m_isWorldObject to check if an object is in grid or world.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Corpse.cpp')
-rw-r--r-- | src/game/Corpse.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 83d21bb3b14..3b3a5fc3cc1 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -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 |