Navigation Menu

Skip to content

Commit

Permalink
Fix #7209: Reset spatial index before removeing peeps on fix save.
Browse files Browse the repository at this point in the history
If the spatial index is corrupted such as in IndianaJones then deleting multiple peeps from the same spatial index will cause an infinite loop. Therefore this will now reset and remake the spatial index if there are peeps that require removing. Note it doesn't reset the spatial index for all saves as it is not required
  • Loading branch information
duncanspumpkin committed Mar 12, 2018
1 parent e0c4f88 commit 33a6a5a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/openrct2/Game.cpp
Expand Up @@ -1251,6 +1251,12 @@ void game_fix_save_vars()
}
}

if (peepsToRemove.size() > 0)
{
// Some broken saves have broken spatial indexes
reset_sprite_spatial_index();
}

for (auto ptr : peepsToRemove)
{
peep_remove(ptr);
Expand Down

0 comments on commit 33a6a5a

Please sign in to comment.