fix #2449: Turning off Day/Night Circle while it is night doesn't reset back to day

This commit is contained in:
IntelOrca 2015-12-08 20:50:30 +00:00
parent 176381b642
commit 08fc36ee49
2 changed files with 19 additions and 15 deletions

View File

@ -2,6 +2,7 @@
------------------------------------------------------------------------
- Fix: [#2126] Ferris Wheels set to "backward rotation" stop working (original
bug)
- Fix: [#2449] Turning off Day/Night Circle while it is night doesn't reset back to day
0.0.3.1-beta (2015-12-04)
------------------------------------------------------------------------

View File

@ -610,11 +610,10 @@ static void scenario_month_update()
static void scenario_update_daynight_cycle()
{
float currentDayNightCycle = gDayNightCycle;
gDayNightCycle = 0;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) != SCREEN_FLAGS_PLAYING) return;
if (!gConfigGeneral.day_night_cycle) return;
if (RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) == SCREEN_FLAGS_PLAYING && gConfigGeneral.day_night_cycle) {
float monthFraction = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_MONTH_TICKS, uint16) / (float)0x10000;
if (monthFraction < (1 / 8.0f)) {
gDayNightCycle = 0.0f;
@ -627,8 +626,12 @@ static void scenario_update_daynight_cycle()
} else {
gDayNightCycle = 0.0f;
}
}
// Only update palette if day / night cycle has changed
if (gDayNightCycle != currentDayNightCycle) {
platform_update_palette(RCT2_ADDRESS(RCT2_ADDRESS_PALETTE, uint8), 10, 236);
}
}
/*