Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable rearm,refuel on dead vehicles #5158

Merged
merged 1 commit into from
May 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addons/rearm/functions/fnc_canRearm.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions addons/rearm/functions/fnc_canStoreAmmo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ||
Expand Down
1 change: 1 addition & 0 deletions addons/rearm/functions/fnc_canTakeAmmo.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ||
Expand Down
2 changes: 1 addition & 1 deletion addons/refuel/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class GVAR(Refuel) { \
displayName = CSTRING(Refuel); \
distance = REFUEL_ACTION_DISTANCE; \
condition = "true"; \
condition = "alive _target"; \
statement = ""; \
showDisabled = 0; \
priority = 2; \
Expand Down
1 change: 1 addition & 0 deletions addons/refuel/functions/fnc_canConnectNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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])})
2 changes: 1 addition & 1 deletion optionals/compat_rhs_afrf3/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class EGVAR(refuel,Refuel) { \
displayName = ECSTRING(refuel,Refuel); \
distance = 7; \
condition = "true"; \
condition = "alive _target"; \
statement = ""; \
showDisabled = 0; \
priority = 2; \
Expand Down
2 changes: 1 addition & 1 deletion optionals/compat_rhs_usf3/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
class EGVAR(refuel,Refuel) { \
displayName = ECSTRING(refuel,Refuel); \
distance = 7; \
condition = "true"; \
condition = "alive _target"; \
statement = ""; \
showDisabled = 0; \
priority = 2; \
Expand Down