From 6eb7497cdf66197168dd24c6817767bc4430863f Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 7 Jun 2015 12:59:53 -0500 Subject: [PATCH] #1208 - Holster key also unholsters --- addons/weaponselect/XEH_postInit.sqf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index 08fa7c97fc..dfb70f4f71 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -110,7 +110,18 @@ if !(hasInterface) exitWith {}; if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; // Statement - [ACE_player] call FUNC(putWeaponAway); + if ((currentWeapon ACE_player) != "") then { + [ACE_player] call FUNC(putWeaponAway); + } else { + private ["_weapon"]; + _weapon = switch (true) do { + case ((primaryWeapon ACE_player) != ""): {primaryWeapon ACE_player}; + case ((handgunWeapon ACE_player) != ""): {handgunWeapon ACE_player}; + case ((secondaryWeapon ACE_player) != ""): {secondaryWeapon ACE_player}; + default {""}; + }; + if (_weapon != "") then {ACE_player selectWeapon _weapon}; + }; true }, {false},