2015-04-20 11:54:22 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE2 Team
|
|
|
|
* Updates GVAR(currentTemperature) based on the map data
|
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-04-20 11:54:22 +00:00
|
|
|
*
|
2016-06-18 09:50:41 +00:00
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
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;
|
2017-10-27 10:39:48 +00:00
|
|
|
GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(temperatureShift) - GVAR(badWeatherShift) * GVAR(currentOvercast);
|
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));
|