Merge pull request #1538 from acemod/unHolsterWeapon

#1208 - Holster key also unholsters
This commit is contained in:
PabstMirror 2015-06-07 14:25:06 -05:00
commit 64d529ed3c

View File

@ -110,7 +110,18 @@ if !(hasInterface) exitWith {};
if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false};
// Statement
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},