From 3b7ec7daa1f1963db5c6622ae5c777ad8ff7655c Mon Sep 17 00:00:00 2001 From: Jeroen D Stout Date: Mon, 25 Sep 2017 15:50:41 +0200 Subject: [PATCH] Alllow check_for_adjacent_station to check farther --- src/openrct2/ride/ride.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/openrct2/ride/ride.c b/src/openrct2/ride/ride.c index 04f299b173..9d07ef001b 100644 --- a/src/openrct2/ride/ride.c +++ b/src/openrct2/ride/ride.c @@ -8478,14 +8478,18 @@ rct_map_element *get_station_platform(sint32 x, sint32 y, sint32 z, sint32 z_tol */ static bool check_for_adjacent_station(sint32 x, sint32 y, sint32 z, uint8 direction) { bool found = false; - sint32 adjX = x + TileDirectionDelta[direction].x; - sint32 adjY = y + TileDirectionDelta[direction].y; - rct_map_element *stationElement = get_station_platform(adjX, adjY, z, 2); - if (stationElement != NULL) { - sint32 rideIndex = stationElement->properties.track.ride_index; - Ride *ride = get_ride(rideIndex); - if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) { - found = true; + sint32 adjX = x; + sint32 adjY = y; + for (int i = 0; i < ride_adjacent_station_max_distance; i++) { + adjX += TileDirectionDelta[direction].x; + adjY += TileDirectionDelta[direction].y; + rct_map_element *stationElement = get_station_platform(adjX, adjY, z, 2); + if (stationElement != NULL) { + sint32 rideIndex = stationElement->properties.track.ride_index; + Ride *ride = get_ride(rideIndex); + if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) { + found = true; + } } } return found;