ACE3/addons/common/functions/fnc_getMagneticBearing.sqf
PabstMirror e399d6f65f cleanup
2024-02-19 18:19:08 -06:00

24 lines
523 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: PabstMirror
* 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]]];
[
(if (_source isEqualType 0) then { _source } else { getDir _source })
+ (missionNamespace getVariable [QGVAR(magneticDeclinationOffset), 0])
] call CBA_fnc_simplifyAngle;