2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-04-20 11:54:22 +00:00
|
|
|
/*
|
|
|
|
* Author: ACE2 Team
|
2017-11-10 14:44:15 +00:00
|
|
|
* Smoothly updates GVAR(currentTemperature) on the server (based on time of day and map data)
|
2015-04-20 11:54:22 +00:00
|
|
|
*
|
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
|
|
|
*/
|
|
|
|
|
2016-01-05 07:39:29 +00:00
|
|
|
private _month = date select 1;
|
2017-11-10 14:44:15 +00:00
|
|
|
private _timeRatio = abs(daytime - 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
|
|
|
|
2017-11-10 14:44:15 +00:00
|
|
|
publicVariable QGVAR(currentTemperature);
|