Should avoid potential conflicts of IED codes.

This commit is contained in:
Garth L-H de Wet 2015-02-04 02:19:56 +02:00
parent 749d068d2d
commit 4d38e19f8c

View File

@ -29,12 +29,16 @@ _detonators = [_unit] call FUNC(getDetonators);
_hasRequired = false;
};
} count _requiredItems;
private ["_code", "_count"];
_code = str(round (random 9999));
_count = 4 - count (toArray _code);
while {_count > 0} do {
_code = "0" + _code;
_count = _count - 1;
private ["_code", "_count", "_codeSet"];
_codeSet = false;
while {!_codeSet} do {
_code = str(round (random 9999));
_count = 4 - count (toArray _code);
while {_count > 0} do {
_code = "0" + _code;
_count = _count - 1;
};
_codeSet = (isNull [objNull,_code] call FUNC(getSpeedDialExplosive));
};
if (isNil QGVAR(CellphoneIEDs)) then {
GVAR(CellphoneIEDs) = [];