ACE3/addons/weather/functions/fnc_updateTemperature.sqf

28 lines
766 B
Plaintext
Raw Normal View History

/*
* Author: ACE2 Team
* Updates GVAR(currentTemperature) based on the map data
*
* Argument:
* Nothing
*
* Return value:
* Nothing
*
* Example:
* [] call ace_weather_fnc_updateTemperature
*
* Public: No
*/
#include "script_component.hpp"
private _time = daytime;
private _month = date select 1;
private _timeRatio = abs(_time - 12) / 12;
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;
2015-04-22 19:16:01 +00:00
TRACE_2("temperatureShift/badWeatherShift",GVAR(temperatureShift),GVAR(badWeatherShift));