From d577d00313c673b51e79181ed8a5eb3146aded9e Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 1 Aug 2009 19:50:42 +0200 Subject: *Store mapId in Corpse class for access to corpse when grid containing them is unloaded and map pointer is unloaded leading to crash. --HG-- branch : trunk --- src/game/Corpse.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/game/Corpse.cpp') diff --git a/src/game/Corpse.cpp b/src/game/Corpse.cpp index 3f6d724b6a8..31cfb700d4b 100644 --- a/src/game/Corpse.cpp +++ b/src/game/Corpse.cpp @@ -39,6 +39,8 @@ Corpse::Corpse(CorpseType type) : WorldObject() m_type = type; + m_mapId = 0; + m_time = time(NULL); lootForBody = false; @@ -198,6 +200,7 @@ bool Corpse::LoadFromDB(uint32 guid, Field *fields, uint32 & mapId, uint32 & in } mapId = fields[4].GetUInt32(); + SetMapId(mapId); instanceId = fields[8].GetUInt32(); m_time = time_t(fields[6].GetUInt64()); -- cgit v1.2.3