diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 4782a8b21c..b790d1d088 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -978,7 +978,7 @@ static StringId window_cheats_page_titles[] = { CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HAPPINESS, 0); break; case WIDX_GUEST_ENERGY_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, PEEP_MAX_ENERGY); + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, kPeepMaxEnergy); break; case WIDX_GUEST_ENERGY_MIN: CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, kPeepMinEnergy); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 9670182296..a2be99c93f 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1101,7 +1101,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); screenCoords.y += LIST_ROW_HEIGHT; DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); - int32_t energy = NormalizeGuestStatValue(peep->Energy - kPeepMinEnergy, PEEP_MAX_ENERGY - kPeepMinEnergy, 10); + int32_t energy = NormalizeGuestStatValue(peep->Energy - kPeepMinEnergy, kPeepMaxEnergy - kPeepMinEnergy, 10); barColour = COLOUR_BRIGHT_GREEN; barBlink = energy < 50; StatsBarsDraw(energy, screenCoords, dpi, barColour, barBlink); diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index eac814f7bc..479303da3a 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -353,7 +353,7 @@ ParametersRange CheatSetAction::GetParameterRange(CheatType cheatType) const { 0, kPeepMaxHappiness } }; case GUEST_PARAMETER_ENERGY: return { { GUEST_PARAMETER_HAPPINESS, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY }, - { kPeepMinEnergy, PEEP_MAX_ENERGY } }; + { kPeepMinEnergy, kPeepMaxEnergy } }; case GUEST_PARAMETER_HUNGER: return { { GUEST_PARAMETER_HAPPINESS, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY }, { 0, kPeepMaxHunger } }; case GUEST_PARAMETER_THIRST: diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 16ecbca191..991fe38702 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -847,7 +847,7 @@ void Guest::Loc68FA89() newEnergy = kPeepMinEnergy; /* Previous code here suggested maximum energy is 128. */ - newEnergy = std::min(static_cast(PEEP_MAX_ENERGY), newEnergy); + newEnergy = std::min(kPeepMaxEnergy, newEnergy); if (newEnergy != Energy) { diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 41007a593e..f88deae7b3 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -21,8 +21,8 @@ #include #include -constexpr int8_t kPeepMinEnergy = 32; -#define PEEP_MAX_ENERGY 128 +constexpr uint8_t kPeepMinEnergy = 32; +constexpr uint8_t kPeepMaxEnergy = 128; #define PEEP_MAX_ENERGY_TARGET 255 // Oddly, this differs from max energy! constexpr auto PEEP_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP;