mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
856ffb5579
* Move ACE Weather rain simulation to server and remove sync (synced correctly by vanilla from server) * Remove lightnings sync (synced correctly by vanilla, ACE3 doesn't have own lightnings probability) * Cleanup rain and lightning settings, strings, comments * Set wind only on server (correctly synced in vanilla, gusts and waves still need manual sync)
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
#include "script_component.hpp"
|
|
|
|
// Rain
|
|
GVAR(rain_next_period) = -1;
|
|
GVAR(rain_period_count) = 0;
|
|
GVAR(current_rain) = 0;
|
|
GVAR(rain_current_range) = -1+(random 2);
|
|
GVAR(rain_period_start_time) = CBA_missionTime;
|
|
GVAR(ACE_rain) = rain;
|
|
|
|
// Wind
|
|
call FUNC(initWind);
|
|
|
|
["ace_settingsInitialized", {
|
|
TRACE_2("ace_settingsInitialized eh",GVAR(enableServerController),GVAR(serverUpdateInterval));
|
|
|
|
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)}];
|
|
|
|
// Create a 1 sec delay PFEH to update rain
|
|
[{
|
|
BEGIN_COUNTER(weatherPFEHserver);
|
|
|
|
GVAR(nextUpdateRain) = 0;
|
|
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;
|
|
};
|
|
}] call CBA_fnc_addEventHandler;
|