1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-22 15:23:01 +01:00

Disallow firing staff who are currently fixing or inspecting rides (#20260)

* Disallow firing staff who are currently fixing or inspecting rides

* Disable fire button when staff member is inspecting/fixing a ride

* Add changelog entry

* Up network version

* Improve error message

---------

Co-authored-by: Rik Smeets <30838294+rik-smeets@users.noreply.github.com>
This commit is contained in:
Matthias Moninger
2023-05-21 19:36:08 +03:00
committed by GitHub
parent 870c78001e
commit b9382ae9fc
6 changed files with 18 additions and 1 deletions

View File

@@ -3693,6 +3693,8 @@ STR_6587 :The OpenRCT2 Title Theme is a work of Allister Brimble,{NEWLINE}lic
STR_6588 :Thanks to Herman Riddering for allowing us to record the 35er Voigt.
STR_6589 :Show window buttons on the left
STR_6590 :Show the window buttons (e.g. to close the window) on the left of the title bar instead of on the right.
STR_6591 :Staff member is currently fixing a ride and cant be fired.
STR_6592 :Staff member is currently inspecting a ride and cant be fired.
#############
# Scenarios #

View File

@@ -8,6 +8,7 @@
- Fix: [#19823] Parkobj: disallow overriding objects of different object types.
- Fix: [#20111] All coaster types can access the new diagonal slope pieces.
- Fix: [#20155] Fairground organ style 2 shows up as regular music, rather than for the merry-go-round.
- Fix: [#20260] Ride locks up when inspecting/fixing staff member is fired.
0.4.5 (2023-05-08)
------------------------------------------------------------------------

View File

@@ -1055,6 +1055,8 @@ private:
{
SetWidgetDisabled(WIDX_PICKUP, true);
}
SetWidgetDisabled(WIDX_FIRE, staff->State == PeepState::Fixing || staff->State == PeepState::Inspecting);
}
}

View File

@@ -49,6 +49,15 @@ GameActions::Result StaffFireAction::Query() const
return GameActions::Result(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
}
if (staff->State == PeepState::Fixing)
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_FIXING, STR_NONE);
}
else if (staff->State == PeepState::Inspecting)
{
return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_FIRE_STAFF_INSPECTING, STR_NONE);
}
return GameActions::Result();
}

View File

@@ -3997,6 +3997,9 @@ enum : uint16_t
STR_WINDOW_BUTTONS_ON_THE_LEFT = 6589,
STR_WINDOW_BUTTONS_ON_THE_LEFT_TIP = 6590,
STR_CANT_FIRE_STAFF_FIXING = 6591,
STR_CANT_FIRE_STAFF_INSPECTING = 6592,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};

View File

@@ -43,7 +43,7 @@
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "3"
#define NETWORK_STREAM_VERSION "4"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION