diff --git a/addons/refuel/functions/fnc_connectNozzle.sqf b/addons/refuel/functions/fnc_connectNozzle.sqf index f5d8d357592..e691b9fab14 100644 --- a/addons/refuel/functions/fnc_connectNozzle.sqf +++ b/addons/refuel/functions/fnc_connectNozzle.sqf @@ -35,8 +35,8 @@ _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR( _actionID = _unit addAction [format ["%1", localize LSTRING(Cancel)], {GVAR(placeAction) = PLACE_CANCEL;}]; [{ - private["_virtualPos", "_virtualPosASL", "_lineInterection"]; - params ["_args","_pfID"]; + private ["_virtualPos", "_virtualPosASL", "_lineInterection"]; + params ["_args", "_pfID"]; _args params ["_unit", "_target", "_nozzle", "_actionID"]; _virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]); diff --git a/addons/refuel/functions/fnc_refuel.sqf b/addons/refuel/functions/fnc_refuel.sqf index 74697212b1e..f33b3f991d8 100644 --- a/addons/refuel/functions/fnc_refuel.sqf +++ b/addons/refuel/functions/fnc_refuel.sqf @@ -29,6 +29,10 @@ _maxFuel = getNumber (configFile >> "CfgVehicles" >> (typeOf _target) >> QGVAR(f params ["_args", "_pfID"]; _args params ["_source", "_sink", "_unit", "_nozzle", "_rate", "_startFuel", "_maxFuel", "_connectFromPoint", "_connectToPoint"]; + if !(_nozzle getVariable [QGVAR(isConnected), false]) exitWith { + [_pfID] call CBA_fnc_removePerFrameHandler; + }; + if (!alive _source || {!alive _sink}) exitWith { [objNull, _nozzle] call FUNC(dropNozzle); _nozzle setVariable [QGVAR(isConnected), false, true];