fixed source of non-deterministicness

This commit is contained in:
zsilencer 2015-07-06 19:07:47 -06:00 committed by IntelOrca
parent 6e3ff0e1df
commit aeeca2454a
3 changed files with 8 additions and 11 deletions

View File

@ -4380,7 +4380,7 @@ void peep_problem_warnings_update()
uint16 guests_in_park = RCT2_GLOBAL(RCT2_ADDRESS_GUESTS_IN_PARK, uint16);
int hunger_counter = 0, lost_counter = 0, noexit_counter = 0, thirst_counter = 0,
litter_counter = 0, disgust_counter = 0, bathroom_counter = 0 ,vandalism_counter = 0;
static int warning_throttle[7] = { 0, 0, 0, 0, 0, 0, 0 };
uint8* warning_throttle = RCT2_ADDRESS(0x01358750, uint8);
RCT2_GLOBAL(RCT2_ADDRESS_RIDE_COUNT, sint16) = ride_get_count(); // refactor this to somewhere else

View File

@ -223,7 +223,7 @@ static void climate_determine_future_weather()
rct_weather_transition transition = climate_table[month];
// Generate a random variable with values 0 upto distribution_size-1 and chose weather from the distribution table accordingly
sint8 next_weather = transition.distribution[ ((rand() & 0xFF) * transition.distribution_size) >> 8 ];
sint8 next_weather = transition.distribution[ ((scenario_rand() & 0xFF) * transition.distribution_size) >> 8 ];
gClimateNextWeather = next_weather;
_climateNextTemperature = transition.base_temperature + climate_weather_data[next_weather].temp_delta;

View File

@ -57,9 +57,6 @@ bool gClearSmallScenery;
bool gClearLargeScenery;
bool gClearFootpath;
int _sub_6A876D_save_x;
int _sub_6A876D_save_y;
static void tiles_init();
static void sub_6A87BB(int x, int y);
static void map_update_grass_length(int x, int y, rct_map_element *mapElement);
@ -296,8 +293,8 @@ void map_init(int size)
}
RCT2_GLOBAL(RCT2_ADDRESS_GRASS_SCENERY_TILEPOS, sint16) = 0;
_sub_6A876D_save_x = 0;
_sub_6A876D_save_y = 0;
RCT2_GLOBAL(0x013CE774, sint16) = 0;
RCT2_GLOBAL(0x013CE776, sint16) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_UNITS, sint16) = size * 32 - 32;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE_MINUS_2, sint16) = size * 32 - 2;
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SIZE, sint16) = size;
@ -572,8 +569,8 @@ void sub_6A876D()
// Presumebly sub_6A87BB is too computationally expensive to call for every
// tile every update, so word_13CE774 and word_13CE776 store the x and y
// progress. A maximum of 128 calls is done per update.
x = _sub_6A876D_save_x;
y = _sub_6A876D_save_y;
x = RCT2_GLOBAL(0x013CE774, sint16);
y = RCT2_GLOBAL(0x013CE776, sint16);
for (i = 0; i < 128; i++) {
sub_6A87BB(x, y);
@ -586,8 +583,8 @@ void sub_6A876D()
y = 0;
}
}
_sub_6A876D_save_x = x;
_sub_6A876D_save_y = y;
RCT2_GLOBAL(0x013CE774, sint16) = x;
RCT2_GLOBAL(0x013CE776, sint16) = y;
}
/**