From 6acd0f05cc1344aac1fe0c6f79742dbe7613bf22 Mon Sep 17 00:00:00 2001 From: Crowdedlight Date: Mon, 4 Mar 2024 19:22:58 +0100 Subject: [PATCH] added PR for ACE arsenal CBA optics support. PR #840 --- .../scripts/client/misc/init_arsenal.sqf | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Missionframework/scripts/client/misc/init_arsenal.sqf b/Missionframework/scripts/client/misc/init_arsenal.sqf index a408676f8..18f5ca1f2 100644 --- a/Missionframework/scripts/client/misc/init_arsenal.sqf +++ b/Missionframework/scripts/client/misc/init_arsenal.sqf @@ -43,6 +43,35 @@ if (KP_liberation_arsenalUsePreset) then { KP_liberation_allowed_items append _disposableLaunchers; }; + { + // Handle CBA optics, https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics + if (missionNamespace getVariable ["CBA_optics", false]) then { + private _pipOptic = CBA_optics_PIPOptics getVariable _x; + if (!isNil "_pipOptic") then { + KP_liberation_allowed_items_extension pushBackUnique _pipOptic; + }; + + private _nonPipOptic = CBA_optics_NonPIPOptics getVariable _x; + if (!isNil "_nonPipOptic") then { + KP_liberation_allowed_items_extension pushBackUnique _nonPipOptic; + }; + }; + + // Handle CBA (MRT) Accessories, https://github.com/CBATeam/CBA_A3/wiki/Accessory-Functions + private _itemCfg = configFile >> "CfgWeapons" >> _x; + if (!isNull _itemCfg) then { + private _nextItem = getText (_cfg >> "MRT_SwitchItemPrevClass"); + if (_nextItem != "") then { + KP_liberation_allowed_items_extension pushBackUnique _nextItem; + }; + + private _prevItem = getText (_cfg >> "MRT_SwitchItemNextClass"); + if (_prevItem != "") then { + KP_liberation_allowed_items_extension pushBackUnique _prevItem; + }; + }; + } forEach KP_liberation_allowed_items; + if ((count GRLIB_arsenal_magazines) == 0) then { if ((count blacklisted_from_arsenal) == 0) then { _magazines = _crawled select 1;