rearm - Skip selectWeapon on nil

Should fix #4006
This commit is contained in:
PabstMirror 2016-06-27 00:00:25 -05:00
parent 21c4efcbba
commit 8bd3332b0e
2 changed files with 7 additions and 2 deletions

View File

@ -20,6 +20,8 @@
private ["_dummy", "_actionID"];
params [["_unit", objNull, [objNull]], ["_delete", false, [false]], ["_unholster", true, [true]]];
if (isNull _unit) exitWith {};
_dummy = _unit getVariable [QGVAR(dummy), objNull];
if !(isNull _dummy) then {
detach _dummy;

View File

@ -33,5 +33,8 @@
#define REARM_UNHOLSTER_WEAPON \
_weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRearm); \
_unit selectWeapon _weaponSelect; \
_unit setVariable [QGVAR(selectedWeaponOnRearm), nil];
TRACE_2("REARM_UNHOLSTER_WEAPON",_unit,_weaponSelect); \
if (!isNil "_weaponSelect") then { \
_unit selectWeapon _weaponSelect; \
_unit setVariable [QGVAR(selectedWeaponOnRearm), nil]; \
}; \