Skip to content
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: 1 addition & 1 deletion addons/refuel/functions/fnc_canTakeNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (isNull _unit ||
{!alive _object} ||
{!isNull (_unit getVariable [QGVAR(nozzle), objNull])} || // Not already carrying a nozzle
{(_object getVariable [QGVAR(jerryCan), false]) && {!isNull (_object getVariable [QGVAR(nozzle), objNull])}} || // Prevent jerry cans from being picked up if they have a nozzle connected
{typeOf _object == QGVAR(fuelNozzle) && {!isNull (attachedTo _object)}} || // Not carried by someone else
{!([_unit, _object, [INTERACT_EXCEPTIONS]] call EFUNC(common,canInteractWith))} || // Not carried by someone else
{([_unit, _object] call EFUNC(interaction,getInteractionDistance)) > REFUEL_ACTION_DISTANCE}) exitWith {false};

!(_object getVariable [QGVAR(isConnected), false]) && {!(_unit getVariable [QGVAR(isRefueling), false])}
3 changes: 3 additions & 0 deletions addons/refuel/functions/fnc_connectNozzleAction.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ private _attachPosModel = _sink worldToModel (ASLtoAGL _bestPosASL);
// Reset fuel counter
_source setVariable [QGVAR(fuelCounter), 0, true];

// Let other players access nozzle
[objNull, _nozzle] call EFUNC(common,claim);

[_unit, _sink, _nozzle, _endPosTestOffset] call FUNC(refuel);

private _canReceive = getNumber ((configOf _sink) >> QGVAR(canReceive)) == 1;
Expand Down
3 changes: 3 additions & 0 deletions addons/refuel/functions/fnc_dropNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ TRACE_3("dropNozzle",_unit,_nozzle,_disconnectOnly);
detach _nozzle;
_nozzle setVariable [QGVAR(isRefueling), false, true];

// Remove claim on nozzle
[objNull, _nozzle] call EFUNC(common,claim);

if (_disconnectOnly) exitWith {};
_nozzle setVelocity [0, 0, 0];

Expand Down
4 changes: 1 addition & 3 deletions addons/refuel/functions/fnc_startNozzleInHandsPFH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ TRACE_2("start",_unit,_nozzle);
_args params ["_unit", "_nozzle"];

if !(
alive _unit
_unit call EFUNC(common,isAwake)
&& {"" isEqualTo currentWeapon _unit || {_unit call EFUNC(common,isSwimming)}}
&& {[_unit, objNull, [INTERACT_EXCEPTIONS, "notOnMap"]] call EFUNC(common,canInteractWith)}
&& {"unconscious" isNotEqualTo toLower animationState _unit}
&& {!(_unit getVariable ["ACE_isUnconscious", false])}
) exitWith {
TRACE_3("stop dead/weapon/interact/uncon",_unit,alive _unit,currentWeapon _unit);
DROP_NOZZLE
Expand Down
8 changes: 7 additions & 1 deletion addons/refuel/functions/fnc_takeNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ params [

private _source = _object;
private _nozzle = _object;
if (typeOf _object isEqualTo QGVAR(fuelNozzle) || {_object getVariable [QGVAR(jerryCan), false]}) then { // func is called on muzzle either connected or on ground
if (typeOf _object isEqualTo QGVAR(fuelNozzle) || {_object getVariable [QGVAR(jerryCan), false]}) then { // func is called on nozzle either connected or on ground
_source = _nozzle getVariable QGVAR(source);
if (_nozzle getVariable [QGVAR(jerryCan), false]) then {
_nozzle attachTo [_unit, [0,1,0], "pelvis"];
} else {
_nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"];
};

// Don't allow other players to take nozzle
[_unit, _nozzle] call EFUNC(common,claim);
} else { // func is called on fuel truck
_nozzle = QGVAR(fuelNozzle) createVehicle [0,0,0];
_nozzle attachTo [_unit, [-0.02,0.05,-0.12], "righthandmiddle1"];

// Don't allow other players to take nozzle
[_unit, _nozzle] call EFUNC(common,claim);

private _ropeTarget = _source;
if !(_source isKindOf "AllVehicles") then {
private _helper = QGVAR(helper) createVehicle [0,0,0];
Expand Down