From 65be883eea0d22644f8cfbe12485e4295dbd31fa Mon Sep 17 00:00:00 2001 From: "Mr. Zorn" <56258612+PulsarNeutronStar@users.noreply.github.com> Date: Thu, 23 Nov 2023 19:16:55 +0100 Subject: [PATCH] Weather - Add variable to temporarily pause wind simulation (#9057) * added exit condition This would enable mission maker to temporarily disable the execution of setWind every second. Currently, a temporary pause isnt possible. * Update weather-framework.md * Apply suggestions from code review Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> * actually disable wind simulation --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com> Co-authored-by: LinkIsGrim --- addons/weather/functions/fnc_updateWeather.sqf | 4 ++-- addons/weather/functions/fnc_updateWind.sqf | 3 +++ docs/wiki/framework/weather-framework.md | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/weather/functions/fnc_updateWeather.sqf b/addons/weather/functions/fnc_updateWeather.sqf index b5495d67c5..d7f629147d 100644 --- a/addons/weather/functions/fnc_updateWeather.sqf +++ b/addons/weather/functions/fnc_updateWeather.sqf @@ -20,8 +20,8 @@ missionNamespace setVariable [QGVAR(currentOvercast), overcast, true]; [] call FUNC(updateTemperature); [] call FUNC(updateHumidity); -// Wind simulation -if (GVAR(windSimulation) && CBA_missionTime > GVAR(next_wind_udpate)) then { +// Wind simulation, take API for temporarily disabling into account along with setting +if (GVAR(windSimulation) && {!(missionNamespace getVariable [QGVAR(disableWindSimulation), false])} && {CBA_missionTime > GVAR(next_wind_udpate)}) then { GVAR(current_wind_direction) = GVAR(next_wind_direction); GVAR(current_wind_speed) = GVAR(next_wind_speed); diff --git a/addons/weather/functions/fnc_updateWind.sqf b/addons/weather/functions/fnc_updateWind.sqf index 0a821b19c0..af3d414a18 100644 --- a/addons/weather/functions/fnc_updateWind.sqf +++ b/addons/weather/functions/fnc_updateWind.sqf @@ -15,6 +15,9 @@ * Public: No */ +// Public API to temporarily disable wind simulation +if (missionNamespace getVariable [QGVAR(disableWindSimulation), false]) exitWith {}; + private _speed = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_speed), GVAR(next_wind_speed), true]; private _direction = linearConversion [GVAR(last_wind_update), GVAR(next_wind_udpate), CBA_missionTime, GVAR(current_wind_direction), GVAR(next_wind_direction), true]; diff --git a/docs/wiki/framework/weather-framework.md b/docs/wiki/framework/weather-framework.md index 4c42ef6ab2..3abdc9d247 100644 --- a/docs/wiki/framework/weather-framework.md +++ b/docs/wiki/framework/weather-framework.md @@ -19,3 +19,10 @@ ACE3 Weather extends the existing weather by temperature, humidity and air press The additional wind simulation, which is also influenced by the season and the geographical location, can be deactivated if necessary. Cloud cover, rain and fog can still be set via the mission settings. + + +## 2. Wind Simulation + +## 2.1 Temporarily Pause Wind Simulation + +When Wind Simulation is enabled at mission start, it can be temporarily disabled by setting `ace_weather_disableWindSimulation = true`. To reenable wind simulation, the variable must either be set to `false` or `nil`. \ No newline at end of file