diff --git a/addons/gunbag/XEH_preInit.sqf b/addons/gunbag/XEH_preInit.sqf index 93e79f14a0..ad244390fa 100644 --- a/addons/gunbag/XEH_preInit.sqf +++ b/addons/gunbag/XEH_preInit.sqf @@ -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;