diff options
author | megamage <none@none> | 2009-08-25 11:42:18 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-25 11:42:18 -0500 |
commit | 8cedad1a0f1e8f58b1b0ff1195fed790e66b6408 (patch) | |
tree | 7e6dd781a51a9a47fc71db289a5ba0c0ff9706d1 /src/game/Corpse.cpp | |
parent | ba78dd144114806d28a8d9615bc7c84623a26989 (diff) |
*Do not make getmapid virtual function to improve speed.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Corpse.cpp')
-rw-r--r-- | src/game/Corpse.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 6aec1da7ef9..16e52ef46aa 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -38,8 +38,6 @@ Corpse::Corpse(CorpseType type) : WorldObject() m_valuesCount = CORPSE_END; - m_mapId = 0; - m_time = time(NULL); lootForBody = false; @@ -193,6 +191,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) float positionY = fields[1].GetFloat(); float positionZ = fields[2].GetFloat(); float ort = fields[3].GetFloat(); + uint32 mapid = fields[4].GetUInt32(); Object::_Create(guid, 0, HIGHGUID_CORPSE); @@ -202,9 +201,6 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) return false; } - SetMapId(fields[4].GetUInt32()); - SetInstanceId(fields[8].GetUInt32()); - m_time = time_t(fields[6].GetUInt64()); m_type = CorpseType(fields[7].GetUInt32()); @@ -217,11 +213,16 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields) if(m_type != CORPSE_BONES) m_isWorldObject = true; + uint32 instanceid = fields[8].GetUInt32(); + uint32 phaseMask = fields[9].GetUInt32(); // overwrite possible wrong/corrupted guid SetUInt64Value(OBJECT_FIELD_GUID, MAKE_NEW_GUID(guid, 0, HIGHGUID_CORPSE)); + // place + SetLocationInstanceId(instanceid); + SetLocationMapId(mapid); SetPhaseMask(phaseMask, false); Relocate(positionX, positionY, positionZ, ort); |