mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fixed completely fucked up temperature day/night cycle
This commit is contained in:
parent
30c27bf689
commit
061b77e375
@ -11,13 +11,13 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_time", "_month", "_hourlyCoef"];
|
||||
private ["_time", "_month", "_timeRatio"];
|
||||
_time = daytime;
|
||||
_month = date select 1;
|
||||
|
||||
_hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440));
|
||||
_timeRatio = abs(_time - 12) / 12;
|
||||
|
||||
GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef;
|
||||
GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _timeRatio) + (GVAR(TempNight) select (_month - 1)) * _timeRatio;
|
||||
GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * overcast;
|
||||
GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user