diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index e92428845f..d3ed2e3098 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -65,8 +65,8 @@ static void cheat_set_grass_length(sint32 length) sint32 x, y; rct_tile_element *tileElement; - for (y = 0; y < 256; y++) { - for (x = 0; x < 256; x++) { + for (y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { + for (x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { tileElement = map_get_surface_element_at(x, y); if (!(tileElement->properties.surface.ownership & OWNERSHIP_OWNED)) continue; diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index f510da080f..6b39a67153 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -1258,9 +1258,9 @@ void game_fix_save_vars() // Fixes broken saves where a surface element could be null // and broken saves with incorrect invisible map border tiles - for (sint32 y = 0; y < 256; y++) + for (sint32 y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { - for (sint32 x = 0; x < 256; x++) + for (sint32 x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { rct_tile_element * tileElement = map_get_surface_element_at(x, y); diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index c8ac1b25e8..6df3b7f2fe 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -102,8 +102,8 @@ void track_design_save_select_nearby_scenery(sint32 rideIndex) { rct_tile_element *tileElement; - for (sint32 y = 0; y < 256; y++) { - for (sint32 x = 0; x < 256; x++) { + for (sint32 y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { + for (sint32 x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { tileElement = map_get_first_element_at(x, y); do { if (track_design_save_should_select_scenery_around(rideIndex, tileElement)) { diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f67fa4d20f..6df787549e 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -683,8 +683,8 @@ void scenario_fix_ghosts(rct_s6_data *s6) // Remove all ghost elements rct_tile_element *destinationElement = s6->tile_elements; - for (sint32 y = 0; y < 256; y++) { - for (sint32 x = 0; x < 256; x++) { + for (sint32 y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) { + for (sint32 x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) { rct_tile_element *originalElement = map_get_first_element_at(x, y); do { if (originalElement->flags & TILE_ELEMENT_FLAG_GHOST) {