Merge pull request #4010 from acemod/rearmHandleNil

rearm - Skip selectWeapon on nil
This commit is contained in:
Glowbal 2016-06-27 19:05:37 +02:00 committed by GitHub
commit d7965233d9
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]; \
}; \