aboutsummaryrefslogtreecommitdiff
path: root/src/game/Corpse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Corpse.cpp')
-rw-r--r--src/game/Corpse.cpp11
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);