mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Moved the global weather controls into preInit
This commit is contained in:
parent
66e4c742b4
commit
b3f4bf306d
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user