diff --git a/addons/rearm/functions/fnc_canRearm.sqf b/addons/rearm/functions/fnc_canRearm.sqf index a0a268cdfa..357eaac8eb 100644 --- a/addons/rearm/functions/fnc_canRearm.sqf +++ b/addons/rearm/functions/fnc_canRearm.sqf @@ -19,6 +19,8 @@ private ["_dummy","_magazineClass"]; params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; +if (!alive _target) exitWith {false}; + if (GVAR(level) == 0 || {isNull _unit} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REARM_ACTION_DISTANCE} || {_target getVariable [QGVAR(disabled), false]}) exitWith {false}; _dummy = _unit getVariable [QGVAR(dummy), objNull]; diff --git a/addons/rearm/functions/fnc_canStoreAmmo.sqf b/addons/rearm/functions/fnc_canStoreAmmo.sqf index a3139d6f11..29c15559a0 100644 --- a/addons/rearm/functions/fnc_canStoreAmmo.sqf +++ b/addons/rearm/functions/fnc_canStoreAmmo.sqf @@ -19,6 +19,7 @@ params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; !(isNull _unit || + {!alive _target} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {(_target distance _unit) > REARM_ACTION_DISTANCE} || diff --git a/addons/rearm/functions/fnc_canTakeAmmo.sqf b/addons/rearm/functions/fnc_canTakeAmmo.sqf index 496e7a12a4..242ff81222 100644 --- a/addons/rearm/functions/fnc_canTakeAmmo.sqf +++ b/addons/rearm/functions/fnc_canTakeAmmo.sqf @@ -19,6 +19,7 @@ params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; !(isNull _unit || + {!alive _target} || {!(_unit isKindOf "CAManBase")} || {!local _unit} || {(_target distance _unit) > REARM_ACTION_DISTANCE} || diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index 4859cd883f..104da38f71 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -5,7 +5,7 @@ class GVAR(Refuel) { \ displayName = CSTRING(Refuel); \ distance = REFUEL_ACTION_DISTANCE; \ - condition = "true"; \ + condition = "alive _target"; \ statement = ""; \ showDisabled = 0; \ priority = 2; \ diff --git a/addons/refuel/functions/fnc_canConnectNozzle.sqf b/addons/refuel/functions/fnc_canConnectNozzle.sqf index 3cd5ac4c58..03cd79d3c6 100644 --- a/addons/refuel/functions/fnc_canConnectNozzle.sqf +++ b/addons/refuel/functions/fnc_canConnectNozzle.sqf @@ -26,6 +26,7 @@ if (_target isKindOf "AllVehicles") then { }; !(isNull _nozzle || + {!alive _target} || {_engine} || {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE} || {!isNull (_target getVariable [QGVAR(nozzle), objNull])}) diff --git a/optionals/compat_rhs_afrf3/CfgVehicles.hpp b/optionals/compat_rhs_afrf3/CfgVehicles.hpp index 3ae5a06f3f..9eca6c1c3a 100644 --- a/optionals/compat_rhs_afrf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_afrf3/CfgVehicles.hpp @@ -28,7 +28,7 @@ class EGVAR(refuel,Refuel) { \ displayName = ECSTRING(refuel,Refuel); \ distance = 7; \ - condition = "true"; \ + condition = "alive _target"; \ statement = ""; \ showDisabled = 0; \ priority = 2; \ diff --git a/optionals/compat_rhs_usf3/CfgVehicles.hpp b/optionals/compat_rhs_usf3/CfgVehicles.hpp index 5350e10867..d37fe7f09b 100644 --- a/optionals/compat_rhs_usf3/CfgVehicles.hpp +++ b/optionals/compat_rhs_usf3/CfgVehicles.hpp @@ -41,7 +41,7 @@ class EGVAR(refuel,Refuel) { \ displayName = ECSTRING(refuel,Refuel); \ distance = 7; \ - condition = "true"; \ + condition = "alive _target"; \ statement = ""; \ showDisabled = 0; \ priority = 2; \