Skip to content

Commit

Permalink
Support CBA Optics and MRT Accesories
Browse files Browse the repository at this point in the history
Obsoletes #833
  • Loading branch information
veteran29 committed Sep 26, 2020
1 parent 9e3188e commit 81affed
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion Missionframework/scripts/client/misc/fn_initArsenal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
File: fn_initArsenal.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2020-05-11
Last Update: 2020-09-16
Last Update: 2020-09-26
License: MIT License - http://www.opensource.org/licenses/MIT
Description:
Expand Down Expand Up @@ -81,6 +81,35 @@ if (KPLIB_param_useArsenalPreset) then {
KPLIB_arsenalAllowed 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 {
KPLIB_arsenalAllowedExtension pushBackUnique _pipOptic;
};

private _nonPipOptic = CBA_optics_NonPIPOptics getVariable _x;
if (!isNil "_nonPipOptic") then {
KPLIB_arsenalAllowedExtension pushBackUnique _nonPipOptic;
};
};

// Handle CBA (MRT) Accessories, https://github.com/CBATeam/CBA_A3/wiki/Accessory-Functions
private _itemCfg = configFile >> "CfgWeapons" >> "CUP_optic_ACOG_TA01B_OD_3D";
if (!isNull _itemCfg) then {
private _nextItem = getText (_cfg >> "MRT_SwitchItemPrevClass");
if (_nextItem != "") then {
KPLIB_arsenalAllowedExtension pushBackUnique _nextItem;
};

private _prevItem = getText (_cfg >> "MRT_SwitchItemNextClass");
if (_prevItem != "") then {
KPLIB_arsenalAllowedExtension pushBackUnique _prevItem;
};
};
} forEach KPLIB_arsenalAllowed;

KPLIB_arsenalAllowed append KPLIB_arsenalAllowedExtension;
if (KPLIB_ace && KPLIB_param_arsenalType) then {[player, KPLIB_arsenalAllowed, false] call ace_arsenal_fnc_addVirtualItems;};

Expand Down

0 comments on commit 81affed

Please sign in to comment.