From ce0650daf55fb1985e785a6c7108f8e5f2f8693a Mon Sep 17 00:00:00 2001 From: blackhand1001 Date: Tue, 17 Oct 2017 17:42:58 -0400 Subject: [PATCH] Change min energy cheat to the correct min value 32. Change min energy cheat to the correct min value 32. This fixes the issue with the min energy cheat that causes it to reset to 255 a few seconds after applying it. --- src/openrct2-ui/windows/Cheats.cpp | 2 +- src/openrct2/peep/Peep.cpp | 4 ++-- src/openrct2/peep/Peep.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index cdf0b0b13e..1021f06145 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -614,7 +614,7 @@ static void window_cheats_guests_mouseup(rct_window *w, rct_widgetindex widgetIn game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_ENERGY, GAME_COMMAND_CHEAT, PEEP_MAX_ENERGY, 0); break; case WIDX_GUEST_ENERGY_MIN: - game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_ENERGY, GAME_COMMAND_CHEAT, 0, 0); + game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_ENERGY, GAME_COMMAND_CHEAT, PEEP_MIN_ENERGY, 0); break; case WIDX_GUEST_HUNGER_MAX: game_do_command(0, GAME_COMMAND_FLAG_APPLY, CHEAT_SETGUESTPARAMETER, GUEST_PARAMETER_HUNGER, GAME_COMMAND_CHEAT, 0, 0); diff --git a/src/openrct2/peep/Peep.cpp b/src/openrct2/peep/Peep.cpp index eb01d6f498..29dc79b005 100644 --- a/src/openrct2/peep/Peep.cpp +++ b/src/openrct2/peep/Peep.cpp @@ -1397,8 +1397,8 @@ static void sub_68F41A(rct_peep * peep, sint32 index) energy = energy_target; } - if (energy < 32) - energy = 32; + if (energy < PEEP_MIN_ENERGY) + energy = PEEP_MIN_ENERGY; /* Previous code here suggested maximum energy is 128. */ energy = Math::Min(static_cast(PEEP_MAX_ENERGY), energy); diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 58464753db..a324ed0f1b 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -32,6 +32,7 @@ #define PEEP_LOST_WARNING_THRESHOLD 8 #define PEEP_MAX_HAPPINESS 255 +#define PEEP_MIN_ENERGY 32 #define PEEP_MAX_ENERGY 128 #define PEEP_MAX_ENERGY_TARGET 255 // Oddly, this differs from max energy!