From 1dbd313fb4b1cee071613a8bf2c184b8b828397e Mon Sep 17 00:00:00 2001 From: Hielke Morsink <123mannetje@gmail.com> Date: Mon, 4 Apr 2016 12:54:02 +0200 Subject: [PATCH] Moved logic from window to map, inside loops that already existed. --- src/windows/map.c | 6 ------ src/world/map.c | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/windows/map.c b/src/windows/map.c index e8fb28dc31..2f81c74f05 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -1349,12 +1349,6 @@ static void map_window_increase_map_size() map_extend_boundary_surface(); window_map_init_map(); window_map_center_on_view_point(); - // Recalculate fences - for (int y = 0; y < RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAX_XY, uint16); y += 32) { - for (int x = 0; x < RCT2_GLOBAL(RCT2_ADDRESS_MAP_MAX_XY, uint16); x += 32) { - update_park_fences(x, y); - } - } gfx_invalidate_screen(); } diff --git a/src/world/map.c b/src/world/map.c index 5013ee1f55..495a8ef87b 100644 --- a/src/world/map.c +++ b/src/world/map.c @@ -4432,6 +4432,8 @@ void map_extend_boundary_surface() newMapElement->properties.surface.slope |= slope; newMapElement->base_height = z; newMapElement->clearance_height = z; + + update_park_fences(x << 5, y << 5); } x = RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, uint16) - 2; @@ -4466,8 +4468,9 @@ void map_extend_boundary_surface() newMapElement->properties.surface.slope |= slope; newMapElement->base_height = z; newMapElement->clearance_height = z; - } + update_park_fences(x << 5, y << 5); + } } /**