From a29e08ed3ccb347433e751c433d8f541c6340dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Badano?= Date: Tue, 20 Jan 2015 23:18:17 -0300 Subject: [PATCH] Ensure the transition time for rain is never 0 --- addons/weather/functions/fnc_serverController.sqf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf index 2adc6e1c38..9ad4d46984 100644 --- a/addons/weather/functions/fnc_serverController.sqf +++ b/addons/weather/functions/fnc_serverController.sqf @@ -11,23 +11,26 @@ if(GVAR(rain_period_count) > GVAR(rain_next_period)) then { GVAR(current_rain) = (GVAR(current_rain)+(((GVAR(current_rain)))*((_rainOverCast*(GVAR(overcast_multiplier)))/8)*GVAR(rain_current_range))); GVAR(current_rain) = (GVAR(current_rain) max 0.01) min 1; - _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20)); + _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; GVAR(rain_current_range) = -1+(random 2); // player sideChat format["lastRain: %1 currentRain: %2", _lastRain, GVAR(current_rain)]; // player sideChat format["_transitionTime: %1", _transitionTime]; - ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; + systemChat format ["ACE_RAIN_PARAMS_sent1: %1 %2 %3", ACE_RAIN_PARAMS]; } else { GVAR(current_rain) = 0; _lastRain = GVAR(current_rain); _rainOverCast = 1; - _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20)); + _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; + ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; + systemChat format ["ACE_RAIN_PARAMS_sent2: %1 %2 %3", ACE_RAIN_PARAMS]; TRACE_4("",_lastRain,_rainOverCast,_transitionTime, overcast); }; + GVAR(rain_period_start_time) = time; publicVariable "ACE_RAIN_PARAMS"; };