mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 16:24:35 +01:00
Increase ride synchronisation range
This commit is contained in:
committed by
Michael Steenbeek
parent
950ab0062f
commit
015d95749c
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user