diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 145134d388..5480797513 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -111,6 +111,8 @@ #define GRAVITY 9.8066 +#define SD_TO_MIN_MAX(d) ((d) * 3.371) // Standard deviation -> min / max of random [min, mid, max] + // Angular unit conversion #define MRAD_TO_MOA(d) ((d) * 3.43774677) // Conversion factor: 54 / (5 * PI) #define MOA_TO_MRAD(d) ((d) * 0.29088821) // Conversion factor: (5 * PI) / 54 diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf index 546daba855..433c161979 100644 --- a/addons/weather/XEH_postServerInit.sqf +++ b/addons/weather/XEH_postServerInit.sqf @@ -3,9 +3,9 @@ ["ace_settingsInitialized", { if (!GVAR(enabled)) exitWith {}; - GVAR(temperatureShift) = random [-5, 0, 5]; - GVAR(badWeatherShift) = random [10, 0, 10]; - GVAR(humidityShift) = random [-0.1, 0, 0.1]; + GVAR(temperatureShift) = random [-SD_TO_MIN_MAX(4), 0, SD_TO_MIN_MAX(4)]; // Gauss(0, 4) + GVAR(badWeatherShift) = random [-SD_TO_MIN_MAX(2) + 4, 4, 4 + SD_TO_MIN_MAX(2)]; // Gauss(4, 2) + GVAR(humidityShift) = random [-SD_TO_MIN_MAX(0.065), 0, SD_TO_MIN_MAX(0.065)]; // Gauss(0, 0.065) if (GVAR(windSimulation)) then { call FUNC(initWind);