From 015d95749c450210533a24bb2e6b38490ec7ed73 Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Sun, 24 Sep 2017 22:18:48 +0200 Subject: [PATCH] Increase ride synchronisation range --- src/openrct2/ride/vehicle.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/vehicle.c b/src/openrct2/ride/vehicle.c index 59c2e93031..10145d7aee 100644 --- a/src/openrct2/ride/vehicle.c +++ b/src/openrct2/ride/vehicle.c @@ -2421,14 +2421,18 @@ static bool vehicle_can_depart_synchronised(rct_vehicle *vehicle) _lastSynchronisedVehicle = _synchronisedVehicles; // Search for stations to sync in both directions from the current tile. + + static const sint32 maxSearchDistance = 5; // How many tiles we are allowed to search // First search direction. sint32 direction = (mapElement->type + 1) & 3; + sint32 spaceBetween; + spaceBetween = maxSearchDistance; while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) { x += TileDirectionDelta[direction].x; y += TileDirectionDelta[direction].y; - if (!try_add_synchronised_station(x, y, z)) { + if (!try_add_synchronised_station(x, y, z) && spaceBetween-- == 0) { break; } } @@ -2439,10 +2443,11 @@ static bool vehicle_can_depart_synchronised(rct_vehicle *vehicle) // Other search direction. direction = (direction ^ 2) & 3; + spaceBetween = maxSearchDistance; while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) { x += TileDirectionDelta[direction].x; y += TileDirectionDelta[direction].y; - if (!try_add_synchronised_station(x, y, z)) { + if (!try_add_synchronised_station(x, y, z) && spaceBetween-- == 0) { break; } }