2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-06-08 13:31:51 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Array <ARRAY>
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_vector_fnc_getDistance
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
#define MIN_DISTANCE 10
|
2015-01-15 06:18:57 +00:00
|
|
|
#define MAX_DISTANCE [6000, 9000] select GVAR(useFeet)
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
disableSerialization;
|
2017-10-10 14:39:59 +00:00
|
|
|
private _dlgVector = GETUVAR(ACE_dlgVector,displayNull);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _distance = ctrlText (_dlgVector displayCtrl 151);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-15 16:24:19 +00:00
|
|
|
if (_distance == "----") exitWith {-1000};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_distance = round parseNumber _distance;
|
|
|
|
|
2015-01-14 19:38:59 +00:00
|
|
|
if (GVAR(useFeet)) then {
|
2015-01-15 06:18:57 +00:00
|
|
|
_distance = 3.28084 * _distance;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|
|
|
|
|
2015-01-15 16:24:19 +00:00
|
|
|
if (_distance > MAX_DISTANCE) exitWith {-1000};
|
|
|
|
if (_distance < MIN_DISTANCE) exitWith {-1000};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
_distance
|