1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 23:04:36 +01:00

fix #3183: opening ride with construction window open

Issue caused with boat hire rides as there is usually a ghost station present when the construction window is open. This causes vehicles to be created in the ghost station. Fixed by closing the construction window before the vehicles are created for the ride.
This commit is contained in:
IntelOrca
2016-03-27 14:18:20 +01:00
parent e6ca13d32c
commit d690ee6423
3 changed files with 24 additions and 1 deletions

View File

@@ -5420,6 +5420,15 @@ void game_command_set_ride_status(int *eax, int *ebx, int *ecx, int *edx, int *e
return;
}
if (*ebx & GAME_COMMAND_FLAG_APPLY) {
// Fix #3183: Make sure we close the construction window so the ride finishes any editing code before opening
// otherwise vehicles get added to the ride incorrectly (such as to a ghost station)
rct_window *constructionWindow = window_find_by_number(WC_RIDE_CONSTRUCTION, rideIndex);
if (constructionWindow != NULL) {
window_close(constructionWindow);
}
}
if (targetStatus == RIDE_STATUS_TESTING) {
if (!ride_is_valid_for_test(rideIndex, targetStatus == RIDE_STATUS_OPEN, *ebx & GAME_COMMAND_FLAG_APPLY)) {
*ebx = MONEY32_UNDEFINED;