ACE3/addons/weather/functions/fnc_updateWind.sqf
Mr. Zorn 65be883eea
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 <salluci.lovi@gmail.com>
2023-11-23 15:16:55 -03:00

25 lines
807 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: ACE2 Team, Ruthberg
* Smoothly updates wind on the server (based on time of year and map data)
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_weather_fnc_updateWind
*
* 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];
setWind [-_speed * sin(_direction), -_speed * cos(_direction), true];