From 923f6efbf8f4726cee1f341b88377f75b08e82aa Mon Sep 17 00:00:00 2001 From: Dystopian Date: Sun, 22 Jul 2018 11:12:30 +0300 Subject: [PATCH 1/2] Allow wirecutter use when unit has RHS Engineer UMBTS backpack --- addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf | 2 +- addons/logistics_wirecutter/functions/fnc_interactEH.sqf | 4 ++-- addons/logistics_wirecutter/script_component.hpp | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 9eb214d8c2b..3f31a7e8411 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -60,7 +60,7 @@ if !(_unit call EFUNC(common,isSwimming)) then { !isNull _fence && {damage _fence < 1} - && {"ACE_wirecutter" in ([_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems)} + && {HAS_WIRECUTTER(_player)} }, ["isNotSwimming"] ] call EFUNC(common,progressBar); diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf index 7a9bb016025..9e64f9edb43 100644 --- a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -24,7 +24,7 @@ params ["_interactionType"]; if ( _interactionType != 0 || {vehicle ACE_player != ACE_player} - || {!("ACE_wirecutter" in ([ACE_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems))} + || {!HAS_WIRECUTTER(ACE_player)} ) exitWith {}; TRACE_1("Starting wirecuter interact PFH",_interactionType); @@ -53,7 +53,7 @@ TRACE_1("Starting wirecuter interact PFH",_interactionType); !isNull _attachedFence && {damage _attachedFence < 1} - && {"ACE_wirecutter" in ([_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems)} + && {HAS_WIRECUTTER(_player)} && {[_player, _attachedFence, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && { // Custom LOS check for fence diff --git a/addons/logistics_wirecutter/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp index 19d1b159b77..112f9a674b5 100644 --- a/addons/logistics_wirecutter/script_component.hpp +++ b/addons/logistics_wirecutter/script_component.hpp @@ -56,3 +56,8 @@ #define SOUND_CLIP_TIME_SPACING 1.5 #define CUT_TIME_DEFAULT 11 #define CUT_TIME_ENGINEER 7.5 + +#define HAS_WIRECUTTER(unit) (\ + "ACE_wirecutter" in ([ARR_6(unit, false, true, true, true, false)] call CBA_fnc_uniqueUnitItems) \ + || {backpack unit isKindOf "rhs_assault_umbts_engineer"} \ +) From 250290342d068838bf382d4f0568b7179ce9d8e1 Mon Sep 17 00:00:00 2001 From: Dystopian Date: Fri, 27 Jul 2018 01:46:04 +0300 Subject: [PATCH 2/2] Move flag from code to config --- addons/logistics_wirecutter/script_component.hpp | 3 ++- optionals/compat_rhs_afrf3/CfgVehicles.hpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/logistics_wirecutter/script_component.hpp b/addons/logistics_wirecutter/script_component.hpp index 112f9a674b5..f971acd88f1 100644 --- a/addons/logistics_wirecutter/script_component.hpp +++ b/addons/logistics_wirecutter/script_component.hpp @@ -59,5 +59,6 @@ #define HAS_WIRECUTTER(unit) (\ "ACE_wirecutter" in ([ARR_6(unit, false, true, true, true, false)] call CBA_fnc_uniqueUnitItems) \ - || {backpack unit isKindOf "rhs_assault_umbts_engineer"} \ + || {1 == getNumber (configFile >> "CfgVehicles" >> (backpack unit) >> QGVAR(hasWirecutter))} \ + || {1 == getNumber (configFile >> "CfgWeapons" >> (vest unit) >> QGVAR(hasWirecutter))} \ ) diff --git a/optionals/compat_rhs_afrf3/CfgVehicles.hpp b/optionals/compat_rhs_afrf3/CfgVehicles.hpp index 60c6b78d9a9..6d27039836e 100644 --- a/optionals/compat_rhs_afrf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_afrf3/CfgVehicles.hpp @@ -218,4 +218,9 @@ class CfgVehicles { class OTR21_Base: Truck_F { EGVAR(refuel,fuelCapacity) = 500; }; + + class rhs_assault_umbts; + class rhs_assault_umbts_engineer: rhs_assault_umbts { + EGVAR(logistics_wirecutter,hasWirecutter) = 1; + }; };