From 9cd502a9f717a4d04aba1c6933ce37cf40807bd6 Mon Sep 17 00:00:00 2001 From: skdltmxn Date: Sun, 6 Feb 2022 03:08:00 +0900 Subject: [PATCH] Fix staff statistics overflow --- data/language/en-GB.txt | 14 +++++++------- src/openrct2-ui/windows/Staff.cpp | 14 +++++++------- src/openrct2/entity/Staff.h | 14 +++++++------- src/openrct2/park/ParkFile.h | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 54bf5c6a8a..352df35239 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -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 diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 0b0a77e31d..5cd7777df7 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1079,37 +1079,37 @@ void WindowStaffStatsPaint(rct_window* w, rct_drawpixelinfo* dpi) { case StaffType::Handyman: ft = Formatter(); - ft.Add(peep->StaffLawnsMown); + ft.Add(peep->StaffLawnsMown); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(peep->StaffGardensWatered); + ft.Add(peep->StaffGardensWatered); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(peep->StaffLitterSwept); + ft.Add(peep->StaffLitterSwept); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(peep->StaffBinsEmptied); + ft.Add(peep->StaffBinsEmptied); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); break; case StaffType::Mechanic: ft = Formatter(); - ft.Add(peep->StaffRidesInspected); + ft.Add(peep->StaffRidesInspected); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); screenCoords.y += LIST_ROW_HEIGHT; ft = Formatter(); - ft.Add(peep->StaffRidesFixed); + ft.Add(peep->StaffRidesFixed); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); break; case StaffType::Security: ft = Formatter(); - ft.Add(peep->StaffVandalsStopped); + ft.Add(peep->StaffVandalsStopped); DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); break; case StaffType::Entertainer: diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index dff443a1aa..e35939a29e 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -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(); diff --git a/src/openrct2/park/ParkFile.h b/src/openrct2/park/ParkFile.h index a58be99eb7..a3f7ba01e4 100644 --- a/src/openrct2/park/ParkFile.h +++ b/src/openrct2/park/ParkFile.h @@ -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