From 454c5aa81993507fbcc1c55e08a3994e2f43c255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 25 May 2023 17:46:27 +0300 Subject: [PATCH] Use unsigned type for ScenarioRand --- src/openrct2/entity/Guest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index cf1da8ddf7..b0f1b893b5 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1300,7 +1300,7 @@ void Guest::UpdateSitting() if (HasFoodOrDrink()) { - if ((ScenarioRand() & 0xFFFF) > 1310) + if ((ScenarioRand() & 0xFFFFU) > 1310U) { TryGetUpFromSitting(); return; @@ -1312,8 +1312,8 @@ void Guest::UpdateSitting() return; } - int32_t rand = ScenarioRand(); - if ((rand & 0xFFFF) > 131) + const auto rand = ScenarioRand(); + if ((rand & 0xFFFFU) > 131U) { TryGetUpFromSitting(); return; @@ -1325,12 +1325,12 @@ void Guest::UpdateSitting() } Action = PeepActionType::SittingLookAroundLeft; - if (rand & 0x80000000) + if (rand & 0x80000000U) { Action = PeepActionType::SittingLookAroundRight; } - if (rand & 0x40000000) + if (rand & 0x40000000U) { Action = PeepActionType::SittingCheckWatch; }