Skip to content

Commit

Permalink
Merge pull request #3018 from jonpas/fixFuelHoseExceededAfterDisconnect
Browse files Browse the repository at this point in the history
Fix refuel PFH not exiting on nozzle disconnect
  • Loading branch information
thojkooi committed Feb 4, 2016
2 parents 1ee4c12 + 33f91b2 commit 3e5908f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/refuel/functions/fnc_connectNozzle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ _unit setVariable [QGVAR(placeActionEH), [_unit, "DefaultAction", {true}, {GVAR(
_actionID = _unit addAction [format ["<t color='#FF0000'>%1</t>", 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]);
Expand Down
4 changes: 4 additions & 0 deletions addons/refuel/functions/fnc_refuel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 3e5908f

Please sign in to comment.