mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #636 from duncanspumpkin/fix_lightning
Fix lightning
This commit is contained in:
commit
e47b2c920f
|
@ -104,6 +104,8 @@ typedef void (EMPTY_ARGS_VOID_POINTER)();
|
|||
typedef unsigned short rct_string_id;
|
||||
|
||||
enum {
|
||||
// Although this is labeled a flag it actually means when
|
||||
// zero the screen is in playing mode.
|
||||
SCREEN_FLAGS_PLAYING = 0,
|
||||
SCREEN_FLAGS_TITLE_DEMO = 1,
|
||||
SCREEN_FLAGS_SCENARIO_EDITOR = 2,
|
||||
|
|
|
@ -174,7 +174,7 @@ static rct_widget window_scenery_widgets[] = {
|
|||
{ WIDGETS_END },
|
||||
};
|
||||
|
||||
static sint16 window_scenery_tab_entries[0x13][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
static sint16 window_scenery_tab_entries[0x14][SCENERY_ENTRIES_BY_TAB + 1];
|
||||
|
||||
/*
|
||||
* Was part of 0x006DFA00
|
||||
|
|
|
@ -100,6 +100,20 @@ void climate_reset(int climate)
|
|||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER_EFFECT, sint8) = climate_weather_data[weather].effect_level;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER_GLOOM, sint8) = climate_weather_data[weather].gloom_level;
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, sint8) = climate_weather_data[weather].rain_level;
|
||||
|
||||
_lightningTimer = 0;
|
||||
_thunderTimer = 0;
|
||||
if (_rainVolume != 1){
|
||||
#ifdef USE_MIXER
|
||||
if (_rainSoundChannel) {
|
||||
Mixer_Stop_Channel(_rainSoundChannel);
|
||||
_rainSoundChannel = 0;
|
||||
}
|
||||
#else
|
||||
sound_stop(&_rainSoundInstance);
|
||||
#endif
|
||||
_rainVolume = 1;
|
||||
}
|
||||
|
||||
climate_determine_future_weather();
|
||||
}
|
||||
|
@ -153,6 +167,8 @@ void climate_update()
|
|||
if (temperature == target_temperature) {
|
||||
if (cur_gloom == next_gloom) {
|
||||
_climateCurrentWeatherEffect = _climateNextWeatherEffect;
|
||||
_thunderTimer = 0;
|
||||
_lightningTimer = 0;
|
||||
|
||||
if (cur_rain == next_rain) {
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_WEATHER, sint8) = gClimateNextWeather;
|
||||
|
@ -224,7 +240,7 @@ void climate_update_sound()
|
|||
return;
|
||||
if (!(RCT2_GLOBAL(0x009AF59D, uint8) & 1))
|
||||
return;
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 1)
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & SCREEN_FLAGS_TITLE_DEMO)
|
||||
return;
|
||||
|
||||
climate_update_rain_sound();
|
||||
|
|
Loading…
Reference in New Issue