From 68370f63d706c3bc3db3d05695b2631e85d501a6 Mon Sep 17 00:00:00 2001 From: jonpas Date: Mon, 17 Aug 2015 01:24:45 +0200 Subject: [PATCH] Fixed returnNozzle function, Moved Return action up --- addons/refuel/CfgVehicles.hpp | 14 +++++++------- addons/refuel/functions/fnc_returnNozzle.sqf | 12 +++++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/addons/refuel/CfgVehicles.hpp b/addons/refuel/CfgVehicles.hpp index f84253f23b..c110c7ce7d 100644 --- a/addons/refuel/CfgVehicles.hpp +++ b/addons/refuel/CfgVehicles.hpp @@ -18,13 +18,6 @@ exceptions[] = {"isNotInside"}; \ icon = PATHTOF(ui\icon_refuel_interact.paa); \ }; \ - class GVAR(CheckFuel) { \ - displayName = CSTRING(CheckFuel); \ - condition = QUOTE([ARR_2(_player,_target)] call FUNC(getFuel) >= 0); \ - statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkFuel)); \ - exceptions[] = {"isNotInside"}; \ - icon = PATHTOF(ui\icon_refuel_interact.paa); \ - }; \ class GVAR(Return) { \ displayName = CSTRING(Return); \ condition = QUOTE([ARR_1(_player)] call FUNC(canConnectNozzle)); \ @@ -32,6 +25,13 @@ exceptions[] = {"isNotInside"}; \ icon = PATHTOF(ui\icon_refuel_interact.paa); \ }; \ + class GVAR(CheckFuel) { \ + displayName = CSTRING(CheckFuel); \ + condition = QUOTE([ARR_2(_player,_target)] call FUNC(getFuel) >= 0); \ + statement = QUOTE([ARR_2(_player,_target)] call FUNC(checkFuel)); \ + exceptions[] = {"isNotInside"}; \ + icon = PATHTOF(ui\icon_refuel_interact.paa); \ + }; \ }; \ }; \ }; diff --git a/addons/refuel/functions/fnc_returnNozzle.sqf b/addons/refuel/functions/fnc_returnNozzle.sqf index 0531fe738c..0bf1bc4406 100644 --- a/addons/refuel/functions/fnc_returnNozzle.sqf +++ b/addons/refuel/functions/fnc_returnNozzle.sqf @@ -25,9 +25,15 @@ _nozzle = _unit getVariable QGVAR(nozzle); if (_source != _target || {isNil "_nozzle"}) exitWith {false}; -_source setVariable [QGVAR(isConnected), false, true]; -ropeDestroy (_nozzle getVariable QGVAR(rope)); -deleteVehicle _nozzle; +_unit setVariable [QGVAR(nozzle), nil]; +detach _nozzle; +[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus); +_unit selectWeapon (_unit getVariable QGVAR(selectedWeaponOnRefuel)); +_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil]; _unit setVariable [QGVAR(isRefueling), false]; +_target setVariable [QGVAR(isConnected), false, true]; +ropeDestroy (_nozzle getVariable QGVAR(rope)); +deleteVehicle _nozzle; + true