1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

Fix staff statistics overflow

This commit is contained in:
skdltmxn
2022-02-06 03:08:00 +09:00
committed by duncanspumpkin
parent da89a4e413
commit 9cd502a9f7
4 changed files with 23 additions and 23 deletions

View File

@@ -1700,12 +1700,12 @@ STR_2347 :{RED}{STRINGID} has drowned!
STR_2348 :Show statistics for this staff member
STR_2349 :{WINDOW_COLOUR_2}Wages: {BLACK}{CURRENCY} per month
STR_2350 :{WINDOW_COLOUR_2}Employed: {BLACK}{MONTHYEAR}
STR_2351 :{WINDOW_COLOUR_2}Lawns mown: {BLACK}{COMMA16}
STR_2352 :{WINDOW_COLOUR_2}Gardens watered: {BLACK}{COMMA16}
STR_2353 :{WINDOW_COLOUR_2}Litter swept: {BLACK}{COMMA16}
STR_2354 :{WINDOW_COLOUR_2}Bins emptied: {BLACK}{COMMA16}
STR_2355 :{WINDOW_COLOUR_2}Rides fixed: {BLACK}{COMMA16}
STR_2356 :{WINDOW_COLOUR_2}Rides inspected: {BLACK}{COMMA16}
STR_2351 :{WINDOW_COLOUR_2}Lawns mown: {BLACK}{COMMA32}
STR_2352 :{WINDOW_COLOUR_2}Gardens watered: {BLACK}{COMMA32}
STR_2353 :{WINDOW_COLOUR_2}Litter swept: {BLACK}{COMMA32}
STR_2354 :{WINDOW_COLOUR_2}Bins emptied: {BLACK}{COMMA32}
STR_2355 :{WINDOW_COLOUR_2}Rides fixed: {BLACK}{COMMA32}
STR_2356 :{WINDOW_COLOUR_2}Rides inspected: {BLACK}{COMMA32}
STR_2358 :Units
STR_2359 :Real Values
STR_2360 :Display Resolution:
@@ -3624,7 +3624,7 @@ STR_6431 :RMB
STR_6432 :Mouse {INT32}
STR_6433 :Remove
STR_6434 :Remove all bindings for this shortcut.
STR_6435 :{WINDOW_COLOUR_2}Vandals stopped: {BLACK}{COMMA16}
STR_6435 :{WINDOW_COLOUR_2}Vandals stopped: {BLACK}{COMMA32}
STR_6436 :Toggle invisibility
STR_6437 :Visible
STR_6438 :V

View File

@@ -1079,37 +1079,37 @@ void WindowStaffStatsPaint(rct_window* w, rct_drawpixelinfo* dpi)
{
case StaffType::Handyman:
ft = Formatter();
ft.Add<uint16_t>(peep->StaffLawnsMown);
ft.Add<uint32_t>(peep->StaffLawnsMown);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint16_t>(peep->StaffGardensWatered);
ft.Add<uint32_t>(peep->StaffGardensWatered);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint16_t>(peep->StaffLitterSwept);
ft.Add<uint32_t>(peep->StaffLitterSwept);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint16_t>(peep->StaffBinsEmptied);
ft.Add<uint32_t>(peep->StaffBinsEmptied);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft);
break;
case StaffType::Mechanic:
ft = Formatter();
ft.Add<uint16_t>(peep->StaffRidesInspected);
ft.Add<uint32_t>(peep->StaffRidesInspected);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft);
screenCoords.y += LIST_ROW_HEIGHT;
ft = Formatter();
ft.Add<uint16_t>(peep->StaffRidesFixed);
ft.Add<uint32_t>(peep->StaffRidesFixed);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft);
break;
case StaffType::Security:
ft = Formatter();
ft.Add<uint16_t>(peep->StaffVandalsStopped);
ft.Add<uint32_t>(peep->StaffVandalsStopped);
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft);
break;
case StaffType::Entertainer:

View File

@@ -38,20 +38,20 @@ public:
uint8_t StaffMowingTimeout;
union
{
uint16_t StaffLawnsMown;
uint16_t StaffRidesFixed;
uint32_t StaffLawnsMown;
uint32_t StaffRidesFixed;
};
union
{
uint16_t StaffGardensWatered;
uint16_t StaffRidesInspected;
uint32_t StaffGardensWatered;
uint32_t StaffRidesInspected;
};
union
{
uint16_t StaffLitterSwept;
uint16_t StaffVandalsStopped;
uint32_t StaffLitterSwept;
uint32_t StaffVandalsStopped;
};
uint16_t StaffBinsEmptied;
uint32_t StaffBinsEmptied;
void UpdateStaff(uint32_t stepsToTake);
void Tick128UpdateStaff();

View File

@@ -8,10 +8,10 @@ struct ObjectRepositoryItem;
namespace OpenRCT2
{
// Current version that is saved.
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 0x8;
constexpr uint32_t PARK_FILE_CURRENT_VERSION = 0x9;
// The minimum version that is forwards compatible with the current version.
constexpr uint32_t PARK_FILE_MIN_VERSION = 0x8;
constexpr uint32_t PARK_FILE_MIN_VERSION = 0x9;
constexpr uint32_t PARK_FILE_MAGIC = 0x4B524150; // PARK