1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Use unsigned type for ScenarioRand

This commit is contained in:
ζeh Matt
2023-05-25 17:46:27 +03:00
parent 66ae20b47b
commit 454c5aa819

View File

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