2015-04-20 11:54:22 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE2 Team
|
|
|
|
* Updates GVAR(currentTemperature) based on the map data
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* Nothing
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Nothing
|
2016-01-05 07:39:29 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [] call ace_weather_fnc_updateTemperature
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-04-20 11:54:22 +00:00
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-01-05 07:39:29 +00:00
|
|
|
private _time = daytime;
|
|
|
|
private _month = date select 1;
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2016-01-05 07:39:29 +00:00
|
|
|
private _timeRatio = abs(_time - 12) / 12;
|
2015-04-20 11:54:22 +00:00
|
|
|
|
2015-05-03 21:32:53 +00:00
|
|
|
GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _timeRatio) + (GVAR(TempNight) select (_month - 1)) * _timeRatio;
|
2015-04-21 18:41:50 +00:00
|
|
|
GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * overcast;
|
2015-04-20 11:54:22 +00:00
|
|
|
GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10;
|
2015-04-22 19:16:01 +00:00
|
|
|
|
|
|
|
TRACE_2("temperatureShift/badWeatherShift",GVAR(temperatureShift),GVAR(badWeatherShift));
|