diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 240276d74cc..8217f99f4ca 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -987,16 +987,15 @@ void Map::Remove(T* obj, bool remove) m_objRemoveList.insert(obj->GetObjectGuid()); - obj->ResetMap(); if (remove) - { // if option set then object already saved at this moment if (!sWorld.getConfig(CONFIG_BOOL_SAVE_RESPAWN_TIME_IMMEDIATELY)) - obj->SaveRespawnTime(); + obj->SaveRespawnTime(); // requires map not being reset - // Note: In case resurrectable corpse and pet its removed from global lists in own destructor + obj->ResetMap(); + + if (remove) // Note: In case resurrectable corpse and pet its removed from global lists in own destructor delete obj; - } } void Map::PlayerRelocation(Player* player, float x, float y, float z, float orientation)