Skip to content

Commit

Permalink
Fix delayed respawnsave crash
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa authored and BadgerBoy81 committed Jul 20, 2022
1 parent 3fda205 commit 3f69c97
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,16 +895,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)
Expand Down

0 comments on commit 3f69c97

Please sign in to comment.