Fix #8584: Ducks spawning function doesnt check tiles 0..63 (original bug) (#8614)

This commit is contained in:
deurklink 2019-01-20 13:20:01 +01:00 committed by Hielke Morsink
parent f16116a321
commit 5e39147b76
3 changed files with 8 additions and 5 deletions

View File

@ -54,6 +54,7 @@
- Fix: [#8469] Crash modifying colour on hacked rides.
- Fix: [#8508] Underground roto-drop is not going up.
- Fix: [#8555] Multiplayer window text limits are not computed properly.
- Fix: [#8584] Duck spawning function does not check tiles with x or y coordinate of 0..63 (original bug).
- Fix: [#8588] Guest list scrolling breaks above ~2000 guests.
- Fix: [#8591] Game loop does not run at a consistent tick rate of 40 Hz.
- Improved: [#2940] Allow mouse-dragging to set patrol area (Singleplayer only).

View File

@ -30,7 +30,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "22"
#define NETWORK_STREAM_VERSION "23"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static rct_peep* _pickup_peep = nullptr;

View File

@ -426,11 +426,13 @@ static int32_t scenario_create_ducks()
{
int32_t i, j, r, c, x, y, waterZ, centreWaterZ, x2, y2;
// Originally, this function generated coordinates from 64 to 191.
// It now generates coordinates from 0 to 255, so smaller maps may also spawn ducks.
r = scenario_rand();
x = ((r >> 16) & 0xFFFF) & 0x7F;
y = (r & 0xFFFF) & 0x7F;
x = (x + 64) * 32;
y = (y + 64) * 32;
x = ((r >> 16) & 0xFFFF) % MAXIMUM_MAP_SIZE_TECHNICAL;
y = (r & 0xFFFF) % MAXIMUM_MAP_SIZE_TECHNICAL;
x = x * 32;
y = y * 32;
if (!map_is_location_in_park({ x, y }))
return 0;