Merge pull request #2130 from F507DMT/patch-23

Update fn_sunRise.sqf - private fix
This commit is contained in:
A Man
2021-05-03 14:13:10 +02:00
committed by GitHub

View File

@@ -14,10 +14,10 @@
Reference: Reference:
http://forums.bistudio.com/showthread.php?107476-How-do-I-detect-sundown-sunrise http://forums.bistudio.com/showthread.php?107476-How-do-I-detect-sundown-sunrise
*/ */
private["_daytime"]; private["_lat","_day","_hour","_daytime"];
_lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude"); _lat = -1 * getNumber(configFile >> "CfgWorlds" >> worldName >> "latitude");
_day = 360 * (dateToNumber date); _day = 360 * (dateToNumber date);
_hour = acos ((24 * sin(_lat) * cos(_day)) / ((12 * cos(_day) - 78) * cos(_lat))); _hour = acos ((24 * sin(_lat) * cos(_day)) / ((12 * cos(_day) - 78) * cos(_lat)));
_daytime = _hour / 360 * 24; _daytime = _hour / 360 * 24;
_daytime _daytime