mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 23:33:04 +01:00
fix #2878: Shops and stalls doesn't open on the server with auto open
Use the set status game command instead of setting the status of the ride directly. In order to stop stack overflow, closing the ride construction window is now done in the update event for that window.
This commit is contained in:
@@ -5152,8 +5152,6 @@ int ride_is_valid_for_open(int rideIndex, int goingToBeOpen, int isApplying)
|
||||
|
||||
ride = get_ride(rideIndex);
|
||||
|
||||
window_close_by_number(WC_RIDE_CONSTRUCTION, rideIndex);
|
||||
|
||||
stationIndex = ride_mode_check_station_present(ride);
|
||||
if (stationIndex == -1)return 0;
|
||||
|
||||
|
||||
@@ -593,7 +593,7 @@ static void window_ride_construction_close(rct_window *w)
|
||||
if (ride_try_get_origin_element(rideIndex, NULL)) {
|
||||
rct_ride *ride = get_ride(rideIndex);
|
||||
if (ride->mode == RIDE_MODE_SHOP_STALL && gConfigGeneral.auto_open_shops) {
|
||||
ride->status = RIDE_STATUS_OPEN;
|
||||
ride_set_status(rideIndex, RIDE_STATUS_OPEN);
|
||||
}
|
||||
|
||||
window_ride_main_open(rideIndex);
|
||||
@@ -1926,6 +1926,12 @@ static void window_ride_construction_exit_click(rct_window *w)
|
||||
*/
|
||||
static void window_ride_construction_update(rct_window *w)
|
||||
{
|
||||
rct_ride *ride = get_ride(_currentRideIndex);
|
||||
if (ride == NULL || ride->status != RIDE_STATUS_CLOSED) {
|
||||
window_close(w);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (_currentTrackCurve) {
|
||||
case 429:
|
||||
case 376:
|
||||
|
||||
Reference in New Issue
Block a user