From dbf816d4bfcb0cf63d4d4f7b913f558fe5428a47 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Mon, 6 Nov 2017 11:56:35 +0100 Subject: [PATCH] Remove unique items from saved and loaded loadouts --- addons/arsenal/XEH_postInit.sqf | 75 --------------------------------- addons/arsenal/defines.hpp | 6 +-- 2 files changed, 2 insertions(+), 79 deletions(-) diff --git a/addons/arsenal/XEH_postInit.sqf b/addons/arsenal/XEH_postInit.sqf index e924e16845..f7ea409de0 100644 --- a/addons/arsenal/XEH_postInit.sqf +++ b/addons/arsenal/XEH_postInit.sqf @@ -78,45 +78,6 @@ if (["ACE_Medical"] call EFUNC(common,isModLoaded)) then { [QGVAR(displayOpened), { GVAR(virtualItems) set [17, (GVAR(virtualItems) select 17) - ["FirstAidKit", "Medikit"]]; }] call CBA_fnc_addEventHandler; - - [QGVAR(onLoadoutSave), { - - params ["_index", "_loadout"]; - _loadout params ["_loadoutName", "_loadoutData"]; - - for "_dataIndex" from 0 to 10 do { - switch (_dataIndex) do { - - case 3; - case 4; - case 5: { - if (count (_loadoutData select _dataIndex) > 0) then { - private _containerContents = (_loadoutData select _dataIndex) select 1; - - if (count _containerContents > 0) then { - - { - if (count _x == 2 && {(_x select 0) isEqualType ""}) then { - - private _item = _x select 0; - if ( - _item isKindOf ["FirstAidKit", (configFile >> "CfgWeapons")] || - _item isKindOf ["Medikit", (configFile >> "CfgWeapons")] - ) then { - - _containerContents set [_foreachIndex, []]; - }; - }; - } foreach _containerContents; - }; - }; - }; - }; - - private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts && {is3DEN}); - _data set [_index, [_loadoutName, _loadoutData]]; - }; - }] call CBA_fnc_addEventHandler; }; if (["ACE_dogtags"] call EFUNC(common,isModLoaded)) then { @@ -144,40 +105,4 @@ if (["ACE_dogtags"] call EFUNC(common,isModLoaded)) then { }; }; }] call CBA_fnc_addEventHandler; - - [QGVAR(onLoadoutSave), { - - params ["_index", "_loadout"]; - _loadout params ["_loadoutName", "_loadoutData"]; - - for "_dataIndex" from 0 to 10 do { - switch (_dataIndex) do { - - case 3; - case 4; - case 5: { - if (count (_loadoutData select _dataIndex) > 0) then { - private _containerContents = (_loadoutData select _dataIndex) select 1; - - if (count _containerContents > 0) then { - - { - if (count _x == 2 && {(_x select 0) isEqualType ""}) then { - - private _item = _x select 0; - if (_item isKindOf ["ACE_dogtag", (configFile >> "CfgWeapons")]) then { - - _containerContents set [_foreachIndex, []]; - }; - }; - } foreach _containerContents; - }; - }; - }; - }; - - private _data = [profileNamespace getVariable [QGVAR(saved_loadouts), []], GVAR(defaultLoadoutsList)] select (GVAR(currentLoadoutsTab) == IDC_buttonDefaultLoadouts && {is3DEN}); - _data set [_index, [_loadoutName, _loadoutData]]; - }; - }] call CBA_fnc_addEventHandler; }; diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index 9cb3f15837..98fe86b7cb 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -265,8 +265,7 @@ {_item in (GVAR(virtualItems) select 12)} ||\ {_item in (GVAR(virtualItems) select 13)} ||\ {_item in (GVAR(virtualItems) select 14)} ||\ - {_item in (GVAR(virtualItems) select 8)} ||\ - {_item in (GVAR(virtualItems) select 18)} + {_item in (GVAR(virtualItems) select 8)} #define CHECK_CONTAINER\ _item in (GVAR(virtualItems) select 4) ||\ @@ -297,5 +296,4 @@ {_item in (GVAR(virtualItems) select 14)} ||\ {_item in (GVAR(virtualItems) select 15)} ||\ {_item in (GVAR(virtualItems) select 16)} ||\ - {_item in (GVAR(virtualItems) select 17)} ||\ - {_item in (GVAR(virtualItems) select 18)} + {_item in (GVAR(virtualItems) select 17)}