ACE3/addons/weather/functions/fnc_serverController.sqf
ulteq cda060d3e0 Weather - Properly sync overcast value (#5688)
* Makes sure that all clients share the same (numeric) overcast value
* Only affects the barometric pressure calculation
* Does not affect the actual weather on the clients
2017-10-27 12:39:48 +02:00

34 lines
1005 B
Plaintext

/*
* Author: Ruthberg
* Gather weather parameters and broadcast them to the clients
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_weather_fnc_serverController
*
* Public: No
*/
#include "script_component.hpp"
if (GVAR(useACEWeather)) then {
// Use location based real world weather data
[] call FUNC(updateAceWeather);
} else {
// Simply replicate the server weather on the clients
if (GVAR(syncWind)) then {
//Wind _dir is the "source" of the wind [eg: "northerly wind": _dir = 0 -> wind = [0,-1,0];]
private _windDir = ((((wind select 0) atan2 (wind select 1)) + 180) % 360);
ACE_WIND_PARAMS = [_windDir, 0, vectorMagnitude wind, 0, GVAR(serverUpdateInterval)];
publicVariable "ACE_WIND_PARAMS";
};
if (GVAR(syncMisc)) then {
ACE_MISC_PARAMS = [overcast, rainbow, fogParams, GVAR(temperatureShift), GVAR(badWeatherShift), GVAR(humidityShift)];
publicVariable "ACE_MISC_PARAMS";
};
};