ACE3/addons/vector/functions/fnc_getDistance.sqf
Dedmen Miller 81e02a7336 Refactor private ARRAY to private keyword (#5598)
* Everything

* Fixed missing ;

* Fix missing ; and double private

* Fixed cannot isNull on number

* Turn _temparture back to isNil

* Fix error from merge
2017-10-10 09:39:59 -05:00

39 lines
671 B
Plaintext

/*
* Author: commy2
*
*
* Arguments:
* None
*
* Return Value:
* Array <ARRAY>
*
* Example:
* call ace_vector_fnc_getDistance
*
* Public: No
*/
#include "script_component.hpp"
#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