From 8450555f0c62aacc52d110b487904caf5a758c42 Mon Sep 17 00:00:00 2001 From: Josuan Albin Date: Sat, 26 Jan 2019 21:13:38 +0100 Subject: [PATCH] Arsenal - Fix arsenal not working reliably on remote AI units. (#6784) * Fix 6701 * Update addons/arsenal/functions/fnc_onArsenalClose.sqf Co-Authored-By: alganthe --- addons/arsenal/functions/fnc_onArsenalClose.sqf | 5 +++++ addons/arsenal/functions/fnc_onSelChangedLeft.sqf | 8 ++++---- addons/zeus/functions/fnc_bi_moduleArsenal.sqf | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/arsenal/functions/fnc_onArsenalClose.sqf b/addons/arsenal/functions/fnc_onArsenalClose.sqf index f4ad7dfed8..554947df85 100644 --- a/addons/arsenal/functions/fnc_onArsenalClose.sqf +++ b/addons/arsenal/functions/fnc_onArsenalClose.sqf @@ -66,6 +66,11 @@ if (is3DEN) then { deleteVehicle GVAR(cameraHelper); camDestroy GVAR(camera); +if (!isNil QGVAR(moduleUsed)) then { + GVAR(moduleUsed) = nil; + objNull remoteControl GVAR(center); +}; + if (isMultiplayer) then { [QGVAR(broadcastFace), [GVAR(center), GVAR(currentFace)], QGVAR(center) + "_face"] call CBA_fnc_globalEventJIP; diff --git a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf index acc1d12741..2322853e1a 100644 --- a/addons/arsenal/functions/fnc_onSelChangedLeft.sqf +++ b/addons/arsenal/functions/fnc_onSelChangedLeft.sqf @@ -57,7 +57,7 @@ switch (GVAR(currentLeftPanel)) do { call _fnc_clearPreviousWepMags; private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; - GVAR(center) addWeaponGlobal _item; + GVAR(center) addWeapon _item; GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; { @@ -95,7 +95,7 @@ switch (GVAR(currentLeftPanel)) do { call _fnc_clearPreviousWepMags; private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; - GVAR(center) addWeaponGlobal _item; + GVAR(center) addWeapon _item; GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; { @@ -132,7 +132,7 @@ switch (GVAR(currentLeftPanel)) do { call _fnc_clearPreviousWepMags; private _compatibleItems = (_item call bis_fnc_compatibleItems) apply {tolower _x}; - GVAR(center) addWeaponGlobal _item; + GVAR(center) addWeapon _item; GVAR(center) addWeaponItem [_item, [(getArray (configfile >> "cfgweapons" >> _item >> "magazines")) select 0]]; { @@ -295,7 +295,7 @@ switch (GVAR(currentLeftPanel)) do { GVAR(currentItems) set [9, _item]; } else { if ((GVAR(currentItems) select 9) != _item) then { - GVAR(center) addWeaponGlobal _item; + GVAR(center) addWeapon _item; GVAR(currentItems) set [9, _item]; call FUNC(showItem); ADDBINOCULARSMAG diff --git a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf index fffca62fc3..65c394a67e 100644 --- a/addons/zeus/functions/fnc_bi_moduleArsenal.sqf +++ b/addons/zeus/functions/fnc_bi_moduleArsenal.sqf @@ -39,6 +39,9 @@ if (_activated && local _logic) then { [{ params ["_unit"]; + player remoteControl _unit; + EGVAR(arsenal,moduleUsed) = true; + [_unit, _unit, true] call EFUNC(arsenal,openBox); }, [_unit]] call CBA_fnc_directCall; } else {