aboutsummaryrefslogtreecommitdiff
path: root/src/game/Corpse.h
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-01 19:50:42 +0200
committerQAston <none@none>2009-08-01 19:50:42 +0200
commitd577d00313c673b51e79181ed8a5eb3146aded9e (patch)
tree294c7d8a7f3b0ce99ce4302fb09058e68a1b2ea5 /src/game/Corpse.h
parentc8c2a3b0da82e3500b92802d4db7fdfcd005b486 (diff)
*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
Diffstat (limited to 'src/game/Corpse.h')
-rw-r--r--src/game/Corpse.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Corpse.h b/src/game/Corpse.h
index e21b0796d62..8e6b43b9d3d 100644
--- a/src/game/Corpse.h
+++ b/src/game/Corpse.h
@@ -67,6 +67,11 @@ class Corpse : public WorldObject
void DeleteBonesFromWorld();
void DeleteFromDB();
+ void SetMap (Map * map) {WorldObject::SetMap(map); m_mapId = map->GetId();}
+ // Used to check object existence in unloaded grids
+ uint32 GetMapId() const {return m_mapId;}
+ void SetMapId (uint32 id) {m_mapId = id;}
+
uint64 const& GetOwnerGUID() const { return GetUInt64Value(CORPSE_FIELD_OWNER); }
time_t const& GetGhostTime() const { return m_time; }
@@ -95,6 +100,7 @@ class Corpse : public WorldObject
CorpseType m_type;
time_t m_time;
GridPair m_grid; // gride for corpse position for fast search
+ uint32 m_mapId; // map id for fast corpse check at packet requests and in other situations with unloaded map of corpse.
};
#endif