mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 17:23:28 +00:00
refactored whole postDroneMarker to be a single executed function, because SQF sucks
This commit is contained in:
@@ -1,3 +1,40 @@
|
||||
params["_drone"];
|
||||
params["_unit"];
|
||||
|
||||
"armatak" callExtension ["post_marker", _drone call armatak_fnc_extract_uav_info];
|
||||
_drone = getConnectedUAVUnit _unit;
|
||||
|
||||
if (isNull _drone) exitWith {};
|
||||
|
||||
private _location = (getPos _drone) call armatak_fnc_convert_location;
|
||||
|
||||
private _atak_uid = _drone call armatak_fnc_extract_uuid;
|
||||
private _atak_latitude = _location select 0;
|
||||
private _atak_longitude = _location select 1;
|
||||
private _atak_speed = speed _drone;
|
||||
private _atak_bearing = parseNumber ((getDir _drone) toFixed 0);
|
||||
private _atak_role = "a-f-A";
|
||||
private _atak_callsign = "[UAV]" + typeOf _drone;
|
||||
private _atak_server_instance = missionNamespace getVariable "_atak_server_instance";
|
||||
private _atak_server_instance_token = missionNamespace getVariable "_atak_server_instance_token";
|
||||
private _atak_altitude = _location select 2;
|
||||
|
||||
switch (side _drone) do {
|
||||
case "WEST": {
|
||||
_atak_role = "a-f-A-M-F-Q"
|
||||
};
|
||||
case "EAST": {
|
||||
_atak_role = "a-h-A-M-F-Q"
|
||||
};
|
||||
case "INDEPENDENT": {
|
||||
_atak_role = "a-n-A-M-F-Q"
|
||||
};
|
||||
case "CIVILIAN": {
|
||||
_atak_role = "a-f-A-C"
|
||||
};
|
||||
default {
|
||||
_atak_role = "a-f-A-M-F-Q"
|
||||
};
|
||||
};
|
||||
|
||||
_drone_info = [_atak_uid, _atak_latitude, _atak_longitude, _atak_speed, _atak_bearing, _atak_role, _atak_callsign, _atak_altitude, _atak_server_instance, _atak_server_instance_token];
|
||||
|
||||
"armatak" callExtension ["post_marker", _drone_info];
|
||||
Reference in New Issue
Block a user