mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
38 lines
673 B
Plaintext
38 lines
673 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
*
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* Array <ARRAY>
|
|
*
|
|
* Example:
|
|
* call ace_vector_fnc_getDistance
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
#define MIN_DISTANCE 10
|
|
#define MAX_DISTANCE [6000, 9000] select GVAR(useFeet)
|
|
|
|
disableSerialization;
|
|
private _dlgVector = GETUVAR(ACE_dlgVector,displayNull);
|
|
|
|
private _distance = ctrlText (_dlgVector displayCtrl 151);
|
|
|
|
if (_distance == "----") exitWith {-1000};
|
|
|
|
_distance = round parseNumber _distance;
|
|
|
|
if (GVAR(useFeet)) then {
|
|
_distance = 3.28084 * _distance;
|
|
};
|
|
|
|
if (_distance > MAX_DISTANCE) exitWith {-1000};
|
|
if (_distance < MIN_DISTANCE) exitWith {-1000};
|
|
|
|
_distance
|