From e5f64bcdc196dd1e414dee9da9d1b97b5cd3837b Mon Sep 17 00:00:00 2001 From: jonpas Date: Fri, 11 Dec 2015 22:45:28 +0100 Subject: [PATCH] Fix refuel PFH not exiting on nozzle disconnect --- addons/refuel/functions/fnc_connectNozzle.sqf | 4 ++-- addons/refuel/functions/fnc_refuel.sqf | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/refuel/functions/fnc_connectNozzle.sqf b/addons/refuel/functions/fnc_connectNozzle.sqf index f5d8d35759..e691b9fab1 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 ed6eb257cf..90729391e0 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; + }; + _fueling = _nozzle getVariable [QGVAR(isRefueling), false]; if (!alive _source || {!alive _sink}) exitWith { [objNull, _nozzle] call FUNC(dropNozzle);