ACE3/addons/weather/XEH_postServerInit.sqf

33 lines
999 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
2015-04-22 19:16:01 +00:00
// 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;
2015-04-22 19:16:01 +00:00
// Wind
call FUNC(initWind);
2016-05-24 13:13:11 +00:00
["ace_settingsInitialized", {
2017-10-17 20:48:02 +00:00
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 {
2017-10-17 20:48:02 +00:00
GVAR(nextUpdateRain) = 0;
2017-10-17 20:48:02 +00:00
addMissionEventHandler ["EachFrame", {
if (CBA_missionTime >= GVAR(nextUpdateRain)) then {
[] call FUNC(updateRain); // Every 2 seconds
GVAR(nextUpdateRain) = 2 + CBA_missionTime;
};
2017-10-17 20:48:02 +00:00
0 setRain GVAR(ACE_rain); // Update rain every frame
}];
};
}] call CBA_fnc_addEventHandler;