ACE3/addons/weather/functions/fnc_updateTemperature.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

26 lines
742 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: ACE2 Team
* Smoothly updates GVAR(currentTemperature) on the server (based on time of day and map data)
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_weather_fnc_updateTemperature
*
* Public: No
*/
private _month = date select 1;
private _timeRatio = abs(daytime - 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) * GVAR(currentOvercast);
GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10;
publicVariable QGVAR(currentTemperature);