From 2da2794e205243f72ee93df86330d94630c9dc9d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 9 May 2015 17:08:47 -0500 Subject: [PATCH] ACE_isUnique config for mags instead of static list --- addons/disarming/functions/fnc_disarmDropItems.sqf | 4 ++-- addons/disarming/script_component.hpp | 1 - addons/vehiclelock/CfgMagazines.hpp | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index cb5da77dd6..bc9abbf127 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -79,7 +79,7 @@ _holderMagazinesStart = magazinesAmmoCargo _holder; { EXPLODE_2_PVT(_x,_xClassname,_xAmmo); - if ((_xClassname in _listOfItemsToRemove) && {!(_xClassname in UNIQUE_MAGAZINES)}) then { + if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then { _holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo]; _target removeMagazine _xClassname; }; @@ -89,7 +89,7 @@ _targetMagazinesEnd = magazinesAmmo _target; _holderMagazinesEnd = magazinesAmmoCargo _holder; //Verify Mags dropped from unit: -if ( ({((_x select 0) in _listOfItemsToRemove) && {!((_x select 0) in UNIQUE_MAGAZINES)}} count _targetMagazinesEnd) != 0) exitWith { +if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish); }; diff --git a/addons/disarming/script_component.hpp b/addons/disarming/script_component.hpp index d9bec366dc..9a1ef9156b 100644 --- a/addons/disarming/script_component.hpp +++ b/addons/disarming/script_component.hpp @@ -13,4 +13,3 @@ #define DISARM_CONTAINER "GroundWeaponHolder" #define DUMMY_ITEM "ACE_DebugPotato" -#define UNIQUE_MAGAZINES ["ACE_key_customKeyMagazine"] \ No newline at end of file diff --git a/addons/vehiclelock/CfgMagazines.hpp b/addons/vehiclelock/CfgMagazines.hpp index 100df8065b..d57e8fff6f 100644 --- a/addons/vehiclelock/CfgMagazines.hpp +++ b/addons/vehiclelock/CfgMagazines.hpp @@ -6,5 +6,6 @@ class CfgMagazines { descriptionShort = "$STR_ACE_Vehicle_Item_Custom_Description"; count = 1; mass = 0; + ACE_isUnique = 1; }; };