diff --git a/addons/weather/ACE_Settings.hpp b/addons/weather/ACE_Settings.hpp index 14e36983f8..d4b5a716cf 100644 --- a/addons/weather/ACE_Settings.hpp +++ b/addons/weather/ACE_Settings.hpp @@ -29,4 +29,10 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(serverUpdateInterval) { + displayName = "Update Interval"; + description = "Defines the interval (seconds) between weather updates"; + typeName = "SCALAR"; + value = 60; + }; }; diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index 7a794bdda0..3de925e446 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -41,6 +41,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class serverUpdateInterval { + displayName = "Update Interval"; + description = "Defines the interval (seconds) between weather updates"; + typeName = "NUMBER"; + defaultValue = 60; + }; }; }; }; diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index 9941cb20b4..5704212b79 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -9,6 +9,4 @@ GVAR(rain_current_range) = -1+(random 2); // Wind call FUNC(initWind); -GVAR(serverUpdateInterval) = 60; - [FUNC(serverController), GVAR(serverUpdateInterval)] call cba_fnc_addPerFrameHandler; diff --git a/addons/weather/functions/fnc_initModuleSettings.sqf b/addons/weather/functions/fnc_initModuleSettings.sqf index 29bfb7e16d..eb0eaafc31 100644 --- a/addons/weather/functions/fnc_initModuleSettings.sqf +++ b/addons/weather/functions/fnc_initModuleSettings.sqf @@ -32,3 +32,8 @@ if !(_activated) exitWith {}; [_logic, QGVAR(syncRain), "syncRain"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(syncWind), "syncWind"] call EFUNC(common,readSettingFromModule); // Wind, Gusts, Waves [_logic, QGVAR(syncMisc), "syncMisc"] call EFUNC(common,readSettingFromModule); // Lightnings, Rainbow, Fog + +// Server weather update interval +[_logic, QGVAR(serverUpdateInterval), "serverUpdateInterval"] call EFUNC(common,readSettingFromModule); + +GVAR(serverUpdateInterval) = 1 max GVAR(serverUpdateInterval) min 600; \ No newline at end of file