mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix server rain PFEH (#5631)
This commit is contained in:
parent
e6f4046bf8
commit
23023ff8ea
@ -12,27 +12,21 @@ GVAR(ACE_rain) = rain;
|
||||
call FUNC(initWind);
|
||||
|
||||
["ace_settingsInitialized", {
|
||||
TRACE_2("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval));
|
||||
TRACE_3("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval),GVAR(useACEWeather));
|
||||
|
||||
if (GVAR(enableServerController)) then {
|
||||
[FUNC(serverController), GVAR(serverUpdateInterval)] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
||||
if (GVAR(useACEWeather)) then {
|
||||
// Update rain every frame
|
||||
addMissionEventHandler ["EachFrame", {0 setRain GVAR(ACE_rain)}];
|
||||
GVAR(nextUpdateRain) = 0;
|
||||
|
||||
// Create a 1 sec delay PFEH to update rain
|
||||
[{
|
||||
BEGIN_COUNTER(weatherPFEHserver);
|
||||
|
||||
GVAR(nextUpdateRain) = 0;
|
||||
addMissionEventHandler ["EachFrame", {
|
||||
if (CBA_missionTime >= GVAR(nextUpdateRain)) then {
|
||||
[] call FUNC(updateRain); // Every 2 seconds
|
||||
GVAR(nextUpdateRain) = 2 + CBA_missionTime;
|
||||
};
|
||||
|
||||
END_COUNTER(weatherPFEHserver);
|
||||
}, 1, []] call CBA_fnc_addPerFrameHandler;
|
||||
0 setRain GVAR(ACE_rain); // Update rain every frame
|
||||
}];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
@ -18,9 +18,6 @@
|
||||
if (!isNil "ACE_RAIN_PARAMS") then {
|
||||
ACE_RAIN_PARAMS params ["_oldRain", "_newRain", "_period"];
|
||||
|
||||
private _periodPosition = (CBA_missionTime - GVAR(rain_period_start_time)) min _period;
|
||||
private _periodPercent = (_periodPosition / _period) min 1;
|
||||
|
||||
GVAR(ACE_Rain) = linearConversion [GVAR(rain_period_start_time), (GVAR(rain_period_start_time) + _period), CBA_missionTime, _oldRain, _newRain];
|
||||
|
||||
TRACE_3("Update Rain",rain,ACE_RAIN_PARAMS,GVAR(ACE_Rain));
|
||||
|
Loading…
Reference in New Issue
Block a user