1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-30 18:25:16 +01:00

Move gPeepSpawns to GameState_t (#21570)

This commit is contained in:
Harry Hopkinson
2024-03-10 18:16:28 +00:00
committed by GitHub
parent 1d3bd31ab8
commit e486606189
15 changed files with 55 additions and 43 deletions

View File

@@ -92,7 +92,6 @@ TileCoordsXY gWidePathTileLoopPosition;
uint16_t gGrassSceneryTileLoopPosition;
std::vector<CoordsXY> gMapSelectionTiles;
std::vector<PeepSpawn> gPeepSpawns;
bool gLandMountainMode;
bool gLandPaintMode;
@@ -1553,12 +1552,13 @@ static void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr)
*/
static void ClearElementsAt(const CoordsXY& loc)
{
auto& gameState = GetGameState();
// Remove the spawn point (if there is one in the current tile)
gPeepSpawns.erase(
gameState.PeepSpawns.erase(
std::remove_if(
gPeepSpawns.begin(), gPeepSpawns.end(),
gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(),
[loc](const CoordsXY& spawn) { return spawn.ToTileStart() == loc.ToTileStart(); }),
gPeepSpawns.end());
gameState.PeepSpawns.end());
TileElement* tileElement = MapGetFirstElementAt(loc);
if (tileElement == nullptr)