Fix rand colours missing final colour (#19901)

This commit is contained in:
Duncan 2023-04-11 22:27:45 +01:00 committed by GitHub
parent e1f2de988e
commit 9493af44dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -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)
------------------------------------------------------------------------

View file

@ -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)

View file

@ -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