Use unsigned type for ScenarioRand

This commit is contained in:
ζeh Matt 2023-05-25 17:46:27 +03:00
parent 66ae20b47b
commit 454c5aa819
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 5 additions and 5 deletions

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