mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Optimise cellphone IED function slightly (#6005)
* Optimise cellphone IED function slightly * Fix distribution and use CBA function
This commit is contained in:
parent
183fc93c5a
commit
4bb16c043c
@ -35,23 +35,16 @@ private _detonators = [_unit] call FUNC(getDetonators);
|
|||||||
} count _requiredItems;
|
} count _requiredItems;
|
||||||
|
|
||||||
private _code = "";
|
private _code = "";
|
||||||
private _codeSet = false;
|
while {true} do {
|
||||||
|
_code = [floor(random 10000), 4] call CBA_fnc_formatNumber;
|
||||||
while {!_codeSet} do {
|
if (([_code] call FUNC(getSpeedDialExplosive)) isEqualTo []) exitWith {};
|
||||||
_code = str(round (random 9999));
|
|
||||||
_count = 4 - count (toArray _code);
|
|
||||||
while {_count > 0} do {
|
|
||||||
_code = "0" + _code;
|
|
||||||
_count = _count - 1;
|
|
||||||
};
|
|
||||||
_codeSet = (count ([_code] call FUNC(getSpeedDialExplosive))) == 0;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNil QGVAR(CellphoneIEDs)) then {
|
if (isNil QGVAR(CellphoneIEDs)) then {
|
||||||
GVAR(CellphoneIEDs) = [];
|
GVAR(CellphoneIEDs) = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
private _count = GVAR(CellphoneIEDs) pushBack [_explosive,_code,GetNumber(ConfigFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")];
|
private _count = GVAR(CellphoneIEDs) pushBack [_explosive, _code, getNumber (configFile >> "CfgMagazines" >> _magazineClass >> "ACE_Triggers" >> "Cellphone" >> "FuseTime")];
|
||||||
_count = _count + 1;
|
_count = _count + 1;
|
||||||
publicVariable QGVAR(CellphoneIEDs);
|
publicVariable QGVAR(CellphoneIEDs);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user