mirror of https://github.com/OpenRCT2/OpenRCT2.git
Recalculating the fences when resizing the map
This commit is contained in:
parent
ed9334f944
commit
15727b68a9
|
@ -1349,6 +1349,12 @@ 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();
|
||||
}
|
||||
|
||||
|
|
|
@ -4384,11 +4384,8 @@ void map_remove_out_of_range_elements()
|
|||
for (int y = 0; y < (256 * 32); y += 32) {
|
||||
for (int x = 0; x < (256 * 32); x += 32) {
|
||||
if (x == 0 || y == 0 || x >= mapMaxXY || y >= mapMaxXY) {
|
||||
map_buy_land_rights(x, y, x, y, 1, GAME_COMMAND_FLAG_APPLY);
|
||||
clear_elements_at(x, y);
|
||||
} else if (x >= mapMaxXY - 32 || y >= mapMaxXY - 32) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16) += 32;
|
||||
map_buy_land_rights(x, y, x, y, 6, GAME_COMMAND_FLAG_APPLY);
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, uint16) -= 32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue