From 1555a4da9f33dd9b1955aea06599c04e459f9f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 28 Aug 2021 00:02:09 +0300 Subject: [PATCH] Modify storage of PeepThought items to 16 bit for rides and shop items --- src/openrct2/peep/Peep.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/openrct2/peep/Peep.h b/src/openrct2/peep/Peep.h index 3a4a446898..2d07b5847c 100644 --- a/src/openrct2/peep/Peep.h +++ b/src/openrct2/peep/Peep.h @@ -485,12 +485,19 @@ enum PeepRideDecision PEEP_RIDE_DECISION_THINKING = 1 << 2, }; +static constexpr uint16_t PeepThoughtItemNone = std::numeric_limits::max(); + struct PeepThought { - PeepThoughtType type; // 0 - uint8_t item; // 1 - uint8_t freshness; // 2 larger is less fresh - uint8_t fresh_timeout; // 3 updates every tick + PeepThoughtType type; + union + { + ride_id_t rideId; + ShopItem shopItem; + uint16_t item; + }; + uint8_t freshness; // larger is less fresh + uint8_t fresh_timeout; // updates every tick }; struct Guest;