Disable rearm,refuel on dead vehicles (#5158)

This commit is contained in:
PabstMirror 2017-05-13 17:36:53 -05:00 committed by GitHub
parent 0cdb2ce238
commit f69148bdc0
7 changed files with 8 additions and 3 deletions

View File

@ -19,6 +19,8 @@
private ["_dummy","_magazineClass"]; private ["_dummy","_magazineClass"];
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; 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}; 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]; _dummy = _unit getVariable [QGVAR(dummy), objNull];

View File

@ -19,6 +19,7 @@
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
!(isNull _unit || !(isNull _unit ||
{!alive _target} ||
{!(_unit isKindOf "CAManBase")} || {!(_unit isKindOf "CAManBase")} ||
{!local _unit} || {!local _unit} ||
{(_target distance _unit) > REARM_ACTION_DISTANCE} || {(_target distance _unit) > REARM_ACTION_DISTANCE} ||

View File

@ -19,6 +19,7 @@
params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]]; params [["_target", objNull, [objNull]], ["_unit", objNull, [objNull]]];
!(isNull _unit || !(isNull _unit ||
{!alive _target} ||
{!(_unit isKindOf "CAManBase")} || {!(_unit isKindOf "CAManBase")} ||
{!local _unit} || {!local _unit} ||
{(_target distance _unit) > REARM_ACTION_DISTANCE} || {(_target distance _unit) > REARM_ACTION_DISTANCE} ||

View File

@ -5,7 +5,7 @@
class GVAR(Refuel) { \ class GVAR(Refuel) { \
displayName = CSTRING(Refuel); \ displayName = CSTRING(Refuel); \
distance = REFUEL_ACTION_DISTANCE; \ distance = REFUEL_ACTION_DISTANCE; \
condition = "true"; \ condition = "alive _target"; \
statement = ""; \ statement = ""; \
showDisabled = 0; \ showDisabled = 0; \
priority = 2; \ priority = 2; \

View File

@ -26,6 +26,7 @@ if (_target isKindOf "AllVehicles") then {
}; };
!(isNull _nozzle || !(isNull _nozzle ||
{!alive _target} ||
{_engine} || {_engine} ||
{([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE} || {([_unit, _target] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE} ||
{!isNull (_target getVariable [QGVAR(nozzle), objNull])}) {!isNull (_target getVariable [QGVAR(nozzle), objNull])})

View File

@ -28,7 +28,7 @@
class EGVAR(refuel,Refuel) { \ class EGVAR(refuel,Refuel) { \
displayName = ECSTRING(refuel,Refuel); \ displayName = ECSTRING(refuel,Refuel); \
distance = 7; \ distance = 7; \
condition = "true"; \ condition = "alive _target"; \
statement = ""; \ statement = ""; \
showDisabled = 0; \ showDisabled = 0; \
priority = 2; \ priority = 2; \

View File

@ -41,7 +41,7 @@
class EGVAR(refuel,Refuel) { \ class EGVAR(refuel,Refuel) { \
displayName = ECSTRING(refuel,Refuel); \ displayName = ECSTRING(refuel,Refuel); \
distance = 7; \ distance = 7; \
condition = "true"; \ condition = "alive _target"; \
statement = ""; \ statement = ""; \
showDisabled = 0; \ showDisabled = 0; \
priority = 2; \ priority = 2; \