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

Use unsigned type for scenario_rand results

This commit is contained in:
Matt
2019-10-16 12:45:00 +02:00
parent 0615ebc56a
commit 07f401baa2

View File

@@ -469,12 +469,12 @@ bool scenario_create_ducks()
centrePos.x += 16;
centrePos.y += 16;
int32_t duckCount = (scenario_rand() & 3) + 2;
for (int32_t i = 0; i < duckCount; i++)
uint32_t duckCount = (scenario_rand() % 4) + 2;
for (uint32_t i = 0; i < duckCount; i++)
{
int32_t r = scenario_rand();
innerPos.x = (r >> 16) & (SquareRadiusSize - 1);
innerPos.y = (r & 0xFFFF) & (SquareRadiusSize - 1);
uint32_t r = scenario_rand();
innerPos.x = (r >> 16) % SquareRadiusSize;
innerPos.y = (r & 0xFFFF) % SquareRadiusSize;
CoordsXY targetPos{ centrePos.x + innerPos.x - SquareRadiusSize, centrePos.y + innerPos.y - SquareRadiusSize };