diff options
Diffstat (limited to 'src/game/Creature.cpp')
-rw-r--r-- | src/game/Creature.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 520e5cb62c3..a1907c9525d 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -191,6 +191,9 @@ void Creature::RemoveFromWorld() ///- Remove the creature from the accessor if(IsInWorld()) { + if(Map *map = FindMap()) + if(map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData()) + ((InstanceMap*)map)->GetInstanceData()->OnCreatureRemove(this); if(m_formation) formation_mgr.RemoveCreatureFromGroup(m_formation, this); ObjectAccessor::Instance().RemoveObject(this); @@ -1371,7 +1374,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 team, const //Notify the map's instance data. //Only works if you create the object in it, not if it is moves to that map. //Normally non-players do not teleport to other maps. - Map *map = MapManager::Instance().FindMap(GetMapId(), GetInstanceId()); + Map *map = FindMap(); if(map && map->IsDungeon() && ((InstanceMap*)map)->GetInstanceData()) { ((InstanceMap*)map)->GetInstanceData()->OnCreatureCreate(this, Entry); |