From 9403ff03e792154b5709a05d8dfdd7da123ce9b5 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 11 Aug 2009 16:14:45 -0500 Subject: *Only use m_isWorldObject to check if an object is in grid or world. --HG-- branch : trunk --- src/game/Corpse.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/game/Corpse.cpp') 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(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 -- cgit v1.2.3