From 5bda207c2cbebf9a6664f2e45bf25db0f8fc7253 Mon Sep 17 00:00:00 2001 From: rwjuk Date: Sat, 12 Aug 2017 14:09:46 +0100 Subject: [PATCH] Fix #5417: Crooked House tracked rides do not dispatch vehicles --- distribution/changelog.txt | 1 + src/openrct2/ride/vehicle.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index cff4e3d81d..0bd6ec73ec 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,6 +4,7 @@ - Feature: [#6078] Game now converts mp.dat to SC21.SC4 (Mega Park) automatically. - Fix: [#816] In the map window, there are more peeps flickering than there are selected (original bug). - Fix: [#1833, #4937, #6138] 'Too low!' warning when building rides and shops on the lowest land level (original bug). +- Fix: [#5417] Hacked Crooked House tracked rides do not dispatch vehicles. - Fix: [#5788] Empty scenario names cause invisible entries in scenario list - Fix: [#6101] Rides remain in ride list window briefly after demolition. - Fix: [#6115] Random title screen music not random on launch diff --git a/src/openrct2/ride/vehicle.c b/src/openrct2/ride/vehicle.c index d6dbd83dd0..f0c6f667cf 100644 --- a/src/openrct2/ride/vehicle.c +++ b/src/openrct2/ride/vehicle.c @@ -1855,7 +1855,14 @@ static int ride_get_train_index_from_vehicle(rct_ride* ride, uint16 spriteIndex) while (ride->vehicles[trainIndex] != spriteIndex) { trainIndex++; - if (trainIndex >= ride->num_vehicles || trainIndex >= countof(ride->vehicles)) + if (trainIndex >= ride->num_vehicles) + { + // This should really return VEHICLE_INVALID_ID, but doing so + // would break some hacked parks that hide track by setting tracked rides' + // track type to, e.g., Crooked House + break; + } + else if (trainIndex >= countof(ride->vehicles)) { return VEHICLE_INVALID_ID; }