diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf index 546938448c..05cd29c093 100644 --- a/addons/weather/XEH_postInit.sqf +++ b/addons/weather/XEH_postInit.sqf @@ -1,9 +1,5 @@ #include "script_component.hpp" -GVAR(syncRain) = true; -GVAR(syncWind) = true; // Wind, Gusts, Waves -GVAR(syncMisc) = true; // Lightnings, Rainbow, Fog - GVAR(wind_period_start_time) = time; GVAR(rain_period_start_time) = time; diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index 70c9341d0f..401ae155c1 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -15,6 +15,14 @@ PREP(updateRain); PREP(updateTemperature); PREP(updateWind); +// Control server side weather propagation +GVAR(enableServerController) = true; + +// Control client side weather effects +GVAR(syncRain) = true; +GVAR(syncWind) = true; // Wind, Gusts, Waves +GVAR(syncMisc) = true; // Lightnings, Rainbow, Fog + // Make sure this data is read before client/server postInit call FUNC(getMapData); diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf index 2d24af89ca..50dcdd8228 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -11,6 +11,8 @@ */ #include "script_component.hpp" +if (!GVAR(enableServerController)) exitWith {}; + private ["_lastRain", "_rainOverCast", "_transitionTime", "_windDirectionVariance", "_windSpeed", "_windSpeedChange", "_windMaxDiff", "_windMinDiff", "_windDirection", "_windDirectionChange", "_ratioMin", "_ratioMax"]; // Rain simulation @@ -27,7 +29,7 @@ if (GVAR(syncRain) && GVAR(rain_period_count) > GVAR(rain_next_period)) then { // Initialize rain with a random strength depending on the current overcast value GVAR(current_rain) = 0.25 + (random 0.25) + (random 0.5) * _rainOverCast; }; - hintSilent format["%1, %2", ((_rainOverCast * GVAR(overcast_multiplier)) / 8), GVAR(rain_current_range)]; + GVAR(current_rain) = GVAR(current_rain) + GVAR(current_rain) * ((_rainOverCast * GVAR(overcast_multiplier)) / 8) * GVAR(rain_current_range); GVAR(current_rain) = 0.01 max GVAR(current_rain) min 1;