mirror of https://github.com/OpenRCT2/OpenRCT2.git
fix #3075: default inspection Interval does not work when building track designs
This commit is contained in:
parent
1867ddf281
commit
6ec5fc8cec
|
@ -8180,6 +8180,18 @@ void game_command_remove_ride_entrance_or_exit(int *eax, int *ebx, int *ecx, int
|
|||
);
|
||||
}
|
||||
|
||||
void ride_set_to_default_inspection_interval(int rideIndex)
|
||||
{
|
||||
rct_ride *ride = get_ride(rideIndex);
|
||||
uint8 defaultInspectionInterval = gConfigGeneral.default_inspection_interval;
|
||||
if (ride->inspection_interval != defaultInspectionInterval) {
|
||||
if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_CHANGE_OPERATING_MODE;
|
||||
game_do_command(0, (defaultInspectionInterval << 8) | 1, 0, (5 << 8) | rideIndex, GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B752C
|
||||
|
|
|
@ -1036,6 +1036,8 @@ void game_command_set_ride_vehicles(int *eax, int *ebx, int *ecx, int *edx, int
|
|||
void game_command_place_ride_entrance_or_exit(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
void game_command_remove_ride_entrance_or_exit(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);
|
||||
|
||||
void ride_set_to_default_inspection_interval(int rideIndex);
|
||||
|
||||
void sub_6CB945(int rideIndex);
|
||||
void ride_crash(uint8 rideIndex, uint8 vehicleIndex);
|
||||
|
||||
|
|
|
@ -3343,7 +3343,8 @@ void game_command_place_track_design(int* eax, int* ebx, int* ecx, int* edx, int
|
|||
uint8 num_circuits = track_design->lift_hill_speed_num_circuits >> 5;
|
||||
if (num_circuits == 0) num_circuits = 1;
|
||||
game_do_command(0, GAME_COMMAND_FLAG_APPLY | (num_circuits << 8), 0, rideIndex | (9 << 8), GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||
|
||||
|
||||
ride_set_to_default_inspection_interval(rideIndex);
|
||||
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN;
|
||||
|
||||
|
|
|
@ -596,13 +596,7 @@ static void window_ride_construction_close(rct_window *w)
|
|||
ride_set_status(rideIndex, RIDE_STATUS_OPEN);
|
||||
}
|
||||
|
||||
uint8 defaultInspectionInterval = gConfigGeneral.default_inspection_interval;
|
||||
if (ride->inspection_interval != defaultInspectionInterval) {
|
||||
if (defaultInspectionInterval <= RIDE_INSPECTION_NEVER) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_GAME_COMMAND_ERROR_TITLE, uint16) = STR_CANT_CHANGE_OPERATING_MODE;
|
||||
game_do_command(0, (defaultInspectionInterval << 8) | 1, 0, (5 << 8) | w->number, GAME_COMMAND_SET_RIDE_SETTING, 0, 0);
|
||||
}
|
||||
}
|
||||
ride_set_to_default_inspection_interval(rideIndex);
|
||||
|
||||
window_ride_main_open(rideIndex);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue