mirror of https://github.com/OpenRCT2/OpenRCT2.git
Prevent breakdown during simulation
This commit is contained in:
parent
5fa0c18455
commit
62ff1e7534
|
@ -3773,6 +3773,7 @@ STR_6322 :{WINDOW_COLOUR_2}Sprite Id: {BLACK}{INT32}
|
||||||
STR_6323 :Simulating
|
STR_6323 :Simulating
|
||||||
STR_6324 :Simulate
|
STR_6324 :Simulate
|
||||||
STR_6325 :{SMALLFONT}{BLACK}Simulate ride/attraction
|
STR_6325 :{SMALLFONT}{BLACK}Simulate ride/attraction
|
||||||
|
STR_6326 :Can't simulate {POP16}{POP16}{POP16}{STRINGID}...
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# Scenarios #
|
# Scenarios #
|
||||||
|
|
|
@ -25,6 +25,7 @@ static rct_string_id _StatusErrorTitles[] = {
|
||||||
STR_CANT_CLOSE,
|
STR_CANT_CLOSE,
|
||||||
STR_CANT_OPEN,
|
STR_CANT_OPEN,
|
||||||
STR_CANT_TEST,
|
STR_CANT_TEST,
|
||||||
|
STR_CANT_SIMULATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_GAME_ACTION(RideSetStatusAction, GAME_COMMAND_SET_RIDE_STATUS, GameActionResult)
|
DEFINE_GAME_ACTION(RideSetStatusAction, GAME_COMMAND_SET_RIDE_STATUS, GameActionResult)
|
||||||
|
@ -73,7 +74,14 @@ public:
|
||||||
|
|
||||||
if (_status != ride->status)
|
if (_status != ride->status)
|
||||||
{
|
{
|
||||||
if (_status == RIDE_STATUS_TESTING || _status == RIDE_STATUS_SIMULATING)
|
if (_status == RIDE_STATUS_SIMULATING && (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN))
|
||||||
|
{
|
||||||
|
// Simulating will force clear the track, so make sure player can't cheat around a break down
|
||||||
|
res->Error = GA_ERROR::DISALLOWED;
|
||||||
|
res->ErrorMessage = STR_HAS_BROKEN_DOWN_AND_REQUIRES_FIXING;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
else if (_status == RIDE_STATUS_TESTING || _status == RIDE_STATUS_SIMULATING)
|
||||||
{
|
{
|
||||||
if (!ride_is_valid_for_test(ride, _status, 0))
|
if (!ride_is_valid_for_test(ride, _status, 0))
|
||||||
{
|
{
|
||||||
|
|
|
@ -3960,6 +3960,7 @@ enum
|
||||||
STR_SIMULATING = 6323,
|
STR_SIMULATING = 6323,
|
||||||
STR_SIMULATE_RIDE = 6324,
|
STR_SIMULATE_RIDE = 6324,
|
||||||
STR_SIMULATE_RIDE_TIP = 6325,
|
STR_SIMULATE_RIDE_TIP = 6325,
|
||||||
|
STR_CANT_SIMULATE = 6326,
|
||||||
|
|
||||||
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
|
||||||
STR_COUNT = 32768
|
STR_COUNT = 32768
|
||||||
|
|
|
@ -2483,7 +2483,7 @@ static void ride_breakdown_update(Ride* ride)
|
||||||
|
|
||||||
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
|
if (ride->lifecycle_flags & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
|
||||||
return;
|
return;
|
||||||
if (ride->status == RIDE_STATUS_CLOSED)
|
if (ride->status == RIDE_STATUS_CLOSED || ride->status == RIDE_STATUS_SIMULATING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ride->CanBreakDown())
|
if (!ride->CanBreakDown())
|
||||||
|
|
Loading…
Reference in New Issue