Skip to content

Commit 38a220e

Browse files
Merge pull request #840 from KillahPotatoes/v0.96.8-cba_optics
V0.96.8 CBA Optics and Accessories support
2 parents 912a035 + 07b9ee9 commit 38a220e

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

Missionframework/scripts/client/misc/fn_initArsenal.sqf

+30-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
File: fn_initArsenal.sqf
33
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
44
Date: 2020-05-11
5-
Last Update: 2020-09-16
5+
Last Update: 2020-09-26
66
License: MIT License - http://www.opensource.org/licenses/MIT
77
88
Description:
@@ -81,6 +81,35 @@ if (KPLIB_param_useArsenalPreset) then {
8181
KPLIB_arsenalAllowed append _disposableLaunchers;
8282
};
8383

84+
{
85+
// Handle CBA optics, https://github.com/CBATeam/CBA_A3/wiki/Scripted-Optics
86+
if (missionNamespace getVariable ["CBA_optics", false]) then {
87+
private _pipOptic = CBA_optics_PIPOptics getVariable _x;
88+
if (!isNil "_pipOptic") then {
89+
KPLIB_arsenalAllowedExtension pushBackUnique _pipOptic;
90+
};
91+
92+
private _nonPipOptic = CBA_optics_NonPIPOptics getVariable _x;
93+
if (!isNil "_nonPipOptic") then {
94+
KPLIB_arsenalAllowedExtension pushBackUnique _nonPipOptic;
95+
};
96+
};
97+
98+
// Handle CBA (MRT) Accessories, https://github.com/CBATeam/CBA_A3/wiki/Accessory-Functions
99+
private _itemCfg = configFile >> "CfgWeapons" >> _x;
100+
if (!isNull _itemCfg) then {
101+
private _nextItem = getText (_cfg >> "MRT_SwitchItemPrevClass");
102+
if (_nextItem != "") then {
103+
KPLIB_arsenalAllowedExtension pushBackUnique _nextItem;
104+
};
105+
106+
private _prevItem = getText (_cfg >> "MRT_SwitchItemNextClass");
107+
if (_prevItem != "") then {
108+
KPLIB_arsenalAllowedExtension pushBackUnique _prevItem;
109+
};
110+
};
111+
} forEach KPLIB_arsenalAllowed;
112+
84113
KPLIB_arsenalAllowed append KPLIB_arsenalAllowedExtension;
85114
if (KPLIB_ace && KPLIB_param_arsenalType) then {[player, KPLIB_arsenalAllowed, false] call ace_arsenal_fnc_addVirtualItems;};
86115

0 commit comments

Comments
 (0)