From 9493af44dd6f03ce51e000c7dd4adf52004c5a4b Mon Sep 17 00:00:00 2001 From: Duncan Date: Tue, 11 Apr 2023 22:27:45 +0100 Subject: [PATCH] Fix rand colours missing final colour (#19901) --- distribution/changelog.txt | 1 + src/openrct2/entity/Guest.cpp | 9 ++++----- src/openrct2/network/NetworkBase.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 422242c7cd..cf96997341 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -16,6 +16,7 @@ - Fix: [#19767] No message when path is not connected to ride exit and is therefore unreachable for mechanics. - Fix: [#19801] The in-game load/save window cannot be resized anymore. - Fix: [#19854] Looping Coaster trains clipping through steep quarter turns down. +- Fix: [#19901] Random shop colours never assigning last colour. 0.4.4 (2023-03-28) ------------------------------------------------------------------------ diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index a052819be4..5b8e28d4c6 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1619,19 +1619,18 @@ bool Guest::DecideAndBuyItem(Ride& ride, ShopItem shopItem, money64 price) const auto hasRandomShopColour = ride.HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); if (shopItem == ShopItem::TShirt) - TshirtColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL - 1)) + TshirtColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL)) : ride.track_colour[0].main; if (shopItem == ShopItem::Hat) - HatColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL - 1)) - : ride.track_colour[0].main; + HatColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL)) : ride.track_colour[0].main; if (shopItem == ShopItem::Balloon) - BalloonColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL - 1)) + BalloonColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL)) : ride.track_colour[0].main; if (shopItem == ShopItem::Umbrella) - UmbrellaColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL - 1)) + UmbrellaColour = hasRandomShopColour ? ColourToPaletteIndex(ScenarioRandMax(COLOUR_NUM_NORMAL)) : ride.track_colour[0].main; if (shopItem == ShopItem::Map) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7dfee822e2..d9cd570809 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -43,7 +43,7 @@ // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "8" +#define NETWORK_STREAM_VERSION "9" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION