Explosives - Add modded defusal kit support (#9353)

* Update CfgWeapons.hpp

* Update XEH_preStart.sqf

* Update XEH_preInit.sqf

* Update fnc_canDefuse.sqf

* Update fnc_canDefuse.sqf

* fix condition

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

* Update fnc_interactEH.sqf

* Update addons/explosives/functions/fnc_interactEH.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
Will/KJW 2023-09-01 21:52:28 +01:00 committed by GitHub
parent c1c1433c44
commit beb4ec8f06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 2 deletions

View File

@ -48,6 +48,7 @@ class CfgWeapons {
picture = QPATHTOF(Data\UI\Pliers.paa);
model = "\A3\Structures_F\Items\Tools\Pliers_F.p3d";
ACE_isTool = 1;
GVAR(defusalKit) = 1;
class ItemInfo: ACE_ExplosiveItem {
mass = 5;

View File

@ -13,4 +13,6 @@ PREP_RECOMPILE_END;
GVAR(detonationHandlers) = [];
GVAR(excludedMines) = [];
GVAR(defusalKits) = call (uiNamespace getVariable QGVAR(defusalKits));
ADDON = true;

View File

@ -1,3 +1,6 @@
#include "script_component.hpp"
#include "XEH_PREP.hpp"
private _defusalKits = (QUOTE(getNumber (_x >> QQGVAR(defusalKit)) > 0) configClasses (configFile >> "CfgWeapons") apply {configName _x});
uiNamespace setVariable [QGVAR(defusalKits), compileFinal str _defusalKits];

View File

@ -24,7 +24,7 @@ if (isNull _explosive) exitWith {
deleteVehicle _target;
false
};
if (vehicle _unit != _unit || {!("ACE_DefusalKit" in (_unit call EFUNC(common,uniqueItems)))}) exitWith {false};
if (vehicle _unit != _unit || {(_unit call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}) exitWith {false};
if (GVAR(RequireSpecialist) && {!([_unit] call EFUNC(Common,isEOD))}) exitWith {false};

View File

@ -25,7 +25,7 @@ TRACE_1("Explosives interactEH",_interactionType);
if (
_interactionType != 0
|| {vehicle ACE_player != ACE_player}
|| {!("ACE_DefusalKit" in (ACE_player call EFUNC(common,uniqueItems)))}
|| {(ACE_player call EFUNC(common,uniqueItems)) findAny GVAR(defusalKits) == -1}
) exitWith {};
[{