2024-02-01 09:09:00 +00:00
|
|
|
#include "..\script_component.hpp"
|
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2024-02-20 00:19:08 +00:00
|
|
|
* Returns magnetic heading (0..360)
|
2024-02-01 09:09:00 +00:00
|
|
|
*
|
|
|
|
* 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;
|