Skip to content

Commit

Permalink
Fix dereference on null iterator (#11154)
Browse files Browse the repository at this point in the history
  • Loading branch information
tupaschoal committed Mar 30, 2020
1 parent dbfb0e4 commit 3d223b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/openrct2/actions/PlacePeepSpawnAction.hpp
Expand Up @@ -101,9 +101,9 @@ DEFINE_GAME_ACTION(PlacePeepSpawnAction, GAME_COMMAND_PLACE_PEEP_SPAWN, GameActi
// If we have reached our max peep spawns, remove the oldest spawns
while (gPeepSpawns.size() >= MAX_PEEP_SPAWNS)
{
auto oldestSpawn = gPeepSpawns.begin();
gPeepSpawns.erase(oldestSpawn);
map_invalidate_tile_full(*oldestSpawn);
PeepSpawn oldestSpawn = *gPeepSpawns.begin();
gPeepSpawns.erase(gPeepSpawns.begin());
map_invalidate_tile_full(oldestSpawn);
}

// Shift the spawn point to the edge of the tile
Expand Down

0 comments on commit 3d223b0

Please sign in to comment.