mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Gunbag - Add check for weapon in virtual items on loadout set (#9358)
* add check for weapon in arsenal virtual items * fix variable Co-authored-by: BrettMayson <brett@mayson.io> * add INFO Co-authored-by: PabstMirror <pabstmirror@gmail.com> --------- Co-authored-by: BrettMayson <brett@mayson.io> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
parent
beb4ec8f06
commit
8439a931e4
@ -30,6 +30,13 @@ PREP_RECOMPILE_END;
|
||||
params ["_unit", "_loadout", "_extendedInfo"];
|
||||
private _gunbagWeapon = _extendedInfo getOrDefault [QGVAR(gunbagWeapon), []];
|
||||
if (_gunbagWeapon isNotEqualTo []) then {
|
||||
if (!isNil QEGVAR(arsenal,virtualItemsFlatAll)) then {
|
||||
private _weapon = (_gunbagWeapon select 0) call EFUNC(arsenal,baseWeapon);
|
||||
if !(_weapon in EGVAR(arsenal,virtualItemsFlatAll)) then {
|
||||
INFO_1("removing [%1] from loadout",_gunbagWeapon);
|
||||
_gunbagWeapon = [];
|
||||
};
|
||||
};
|
||||
(backpackContainer _unit) setVariable [QGVAR(gunbagWeapon), _gunbagWeapon, true];
|
||||
};
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
Loading…
Reference in New Issue
Block a user