diff --git a/src/game.c b/src/game.c index 3917b22f7b..031004097b 100644 --- a/src/game.c +++ b/src/game.c @@ -853,6 +853,8 @@ int game_load_network(SDL_RWops* rw) // Read other data not in normal save files RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32) = SDL_ReadLE32(rw); + _guestGenerationProbability = SDL_ReadLE32(rw); + _suggestedGuestMaximum = SDL_ReadLE32(rw); if (!load_success){ set_load_objects_fail_reason(); diff --git a/src/peep/peep.c b/src/peep/peep.c index 108443b4d9..5af670f172 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -7206,7 +7206,7 @@ static uint16 sub_69A997(sint16 x, sint16 y, uint8 z, uint8 counter, uint16 scor do { edges &= ~(1 << test_edge); - int saved_f1aedc = RCT2_GLOBAL(0x00F1AEDC, int); + sint8 saved_f1aedc = RCT2_GLOBAL(0x00F1AEDC, sint8); uint8 height = z; RCT2_GLOBAL(0x00F1AEDE, sint16) = 0; if (footpath_element_is_sloped(path) && @@ -7214,7 +7214,7 @@ static uint16 sub_69A997(sint16 x, sint16 y, uint8 z, uint8 counter, uint16 scor height += 2; } score = sub_69A997(x, y, height, counter, score, test_edge); - RCT2_GLOBAL(0x00F1AEDC, int) = saved_f1aedc; + RCT2_GLOBAL(0x00F1AEDC, sint8) = saved_f1aedc; } while ((test_edge = bitscanforward(edges)) != -1); return score; @@ -7265,7 +7265,7 @@ static int guest_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep for (int test_edge = chosen_edge; test_edge != -1; test_edge = bitscanforward(edges)) { edges &= ~(1 << test_edge); uint8 height = z; - int saved_f1aedc = RCT2_GLOBAL(0x00F1AEDC, int); + sint8 saved_f1aedc = RCT2_GLOBAL(0x00F1AEDC, sint8); if (footpath_element_is_sloped(dest_map_element) && footpath_element_get_slope_direction(dest_map_element) == test_edge) height += 0x2; @@ -7274,7 +7274,7 @@ static int guest_pathfind_choose_direction(sint16 x, sint16 y, uint8 z, rct_peep RCT2_GLOBAL(0x00F1AED4, int) = RCT2_GLOBAL(0x00F1AED8, int); RCT2_GLOBAL(0x00F1AEDE, uint16) = 0; uint16 score = sub_69A997(x, y, height, 0, 0xFFFF, test_edge); - RCT2_GLOBAL(0x00F1AEDC, int) = saved_f1aedc; + RCT2_GLOBAL(0x00F1AEDC, sint8) = saved_f1aedc; if (score < best_score || (score == best_score && RCT2_GLOBAL(0x00F1AED3, uint8) < best_sub)) { chosen_edge = test_edge; diff --git a/src/scenario.c b/src/scenario.c index 040408b39d..3c42ac8a71 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -1091,6 +1091,8 @@ int scenario_save_network(SDL_RWops* rw) // Write other data not in normal save files SDL_WriteLE32(rw, RCT2_GLOBAL(RCT2_ADDRESS_GAME_PAUSED, uint32)); + SDL_WriteLE32(rw, _guestGenerationProbability); + SDL_WriteLE32(rw, _suggestedGuestMaximum); gfx_invalidate_screen(); return 1; diff --git a/src/world/climate.c b/src/world/climate.c index e81b418912..7f360263c3 100644 --- a/src/world/climate.c +++ b/src/world/climate.c @@ -287,7 +287,7 @@ static void climate_update_thunder_sound() climate_update_thunder(); } else if (_climateCurrentWeatherEffect == 2) { // Create new thunder and lightning - unsigned int randomNumber = scenario_rand(); + unsigned int randomNumber = util_rand(); if ((randomNumber & 0xFFFF) <= 0x1B4) { randomNumber >>= 16; _thunderTimer = 43 + (randomNumber % 64); @@ -314,7 +314,7 @@ static void climate_update_lightning() _lightningTimer--; if (RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint16) == 0) - if ((scenario_rand() & 0xFFFF) <= 0x2000) + if ((util_rand() & 0xFFFF) <= 0x2000) RCT2_GLOBAL(RCT2_ADDRESS_LIGHTNING_ACTIVE, uint16) = 1; } @@ -324,7 +324,7 @@ static void climate_update_thunder() if (_thunderTimer != 0) return; - unsigned int randomNumber = scenario_rand(); + unsigned int randomNumber = util_rand(); if (randomNumber & 0x10000) { if (_thunderStatus[0] == THUNDER_STATUS_NULL && _thunderStatus[1] == THUNDER_STATUS_NULL) { // Play thunder on left side diff --git a/src/world/park.h b/src/world/park.h index 5f24a295e4..80bb6c6eec 100644 --- a/src/world/park.h +++ b/src/world/park.h @@ -49,6 +49,8 @@ enum { extern uint8 *gParkRatingHistory; extern uint8 *gGuestsInParkHistory; +extern int _guestGenerationProbability; +extern int _suggestedGuestMaximum; void set_forced_park_rating(); int get_forced_park_rating();