diff --git a/src/cheats.c b/src/cheats.c index 4c0de9e44f..c97f340309 100644 --- a/src/cheats.c +++ b/src/cheats.c @@ -20,6 +20,7 @@ bool gCheatsBuildInPauseMode = false; bool gCheatsIgnoreRideIntensity = false; bool gCheatsDisableVandalism = false; bool gCheatsNeverendingMarketing = false; +bool gCheatsFreezeClimate = false; int park_rating_spinner_value; @@ -383,7 +384,7 @@ void game_command_cheat(int* eax, int* ebx, int* ecx, int* edx, int* esi, int* e case CHEAT_10MINUTEINSPECTIONS: cheat_10_minute_inspections(); break; case CHEAT_WINSCENARIO: scenario_success(); break; case CHEAT_FORCEWEATHER: climate_force_weather(*edx); break; - case CHEAT_FREEZECLIMATE: toggle_climate_lock(); break; + case CHEAT_FREEZECLIMATE: gCheatsFreezeClimate = !gCheatsFreezeClimate; break; case CHEAT_NEVERENDINGMARKETING: gCheatsNeverendingMarketing = !gCheatsNeverendingMarketing; break; case CHEAT_OPENCLOSEPARK: park_set_open(park_is_open() ? 0 : 1); break; case CHEAT_HAVEFUN: RCT2_GLOBAL(RCT2_ADDRESS_OBJECTIVE_TYPE, uint8) = OBJECTIVE_HAVE_FUN; break; @@ -411,4 +412,6 @@ void cheats_reset() gCheatsBuildInPauseMode = false; gCheatsIgnoreRideIntensity = false; gCheatsDisableVandalism = false; + gCheatsNeverendingMarketing = false; + gCheatsFreezeClimate = false; } diff --git a/src/cheats.h b/src/cheats.h index b65f21d4f3..64e50bf480 100644 --- a/src/cheats.h +++ b/src/cheats.h @@ -36,6 +36,7 @@ extern bool gCheatsBuildInPauseMode; extern bool gCheatsIgnoreRideIntensity; extern bool gCheatsDisableVandalism; extern bool gCheatsNeverendingMarketing; +extern bool gCheatsFreezeClimate; enum { CHEAT_SANDBOXMODE, diff --git a/src/windows/cheats.c b/src/windows/cheats.c index 4a61d181c1..c1af3b3783 100644 --- a/src/windows/cheats.c +++ b/src/windows/cheats.c @@ -770,7 +770,7 @@ static void window_cheats_invalidate(rct_window *w) widget_set_checkbox_value(w, WIDX_UNLOCK_ALL_PRICES, gCheatsUnlockAllPrices); widget_set_checkbox_value(w, WIDX_FORCE_PARK_RATING, get_forced_park_rating() >= 0); w->widgets[WIDX_SANDBOX_MODE].image = gCheatsSandboxMode ? STR_CHEAT_SANDBOX_MODE_DISABLE : STR_CHEAT_SANDBOX_MODE; - w->widgets[WIDX_FREEZE_CLIMATE].image = g_climate_locked ? STR_CHEAT_UNFREEZE_CLIMATE : STR_CHEAT_FREEZE_CLIMATE; + w->widgets[WIDX_FREEZE_CLIMATE].image = gCheatsFreezeClimate ? STR_CHEAT_UNFREEZE_CLIMATE : STR_CHEAT_FREEZE_CLIMATE; widget_set_checkbox_value(w, WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing); break; case WINDOW_CHEATS_PAGE_RIDES: diff --git a/src/world/climate.c b/src/world/climate.c index 7f360263c3..f146f25b60 100644 --- a/src/world/climate.c +++ b/src/world/climate.c @@ -29,6 +29,7 @@ #include "../interface/window.h" #include "../util/util.h" #include "climate.h" +#include "../cheats.h" enum { THUNDER_STATUS_NULL = 0, @@ -84,10 +85,6 @@ int climate_celsius_to_fahrenheit(int celsius) return (celsius * 29) / 16 + 32; } -// cheats -int g_climate_locked; -extern void toggle_climate_lock(); - /** * Set climate and determine start weather. * rct2: 0x006C45ED @@ -124,13 +121,6 @@ sint8 step_weather_level(sint8 cur_weather_level, sint8 next_weather_level) { } } - -//for cheats -void toggle_climate_lock() -{ - g_climate_locked = !g_climate_locked; -} - /** * Weather & climate update iteration. * Gradually changes the weather parameters towards their determined next values. @@ -147,7 +137,7 @@ void climate_update() cur_rain = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_RAIN_LEVEL, sint8), next_rain = _climateNextRainLevel; - if (g_climate_locked) //for cheats + if (gCheatsFreezeClimate) //for cheats return; if (screen_flags & (~SCREEN_FLAGS_PLAYING)) // only normal play mode gets climate diff --git a/src/world/climate.h b/src/world/climate.h index 1e600692ae..d7d995edf4 100644 --- a/src/world/climate.h +++ b/src/world/climate.h @@ -53,10 +53,6 @@ typedef struct { extern const rct_weather climate_weather_data[6]; -// cheats -extern int g_climate_locked; -void toggle_climate_lock(); - int climate_celsius_to_fahrenheit(int celsius); void climate_reset(int climate); void climate_update();