ACE3/addons/common/functions/fnc_getMagneticBearing.sqf

24 lines
523 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
/*
* Author: PabstMirror
2024-02-20 00:19:08 +00:00
* Returns magnetic heading (0..360)
*
* Arguments:
* 0: Object or Bearing <OBJECT><NUMBER>
*
* Return Value:
* Compass Bearing <NUMBER>
*
* Example:
* [player] call ace_common_fnc_getMagneticBearing
*
* Public: Yes
*/
params [["_source", ace_player, [objNull, 0]]];
2024-02-20 00:19:08 +00:00
[
(if (_source isEqualType 0) then { _source } else { getDir _source })
+ (missionNamespace getVariable [QGVAR(magneticDeclinationOffset), 0])
] call CBA_fnc_simplifyAngle;