Fixed returnNozzle function, Moved Return action up

This commit is contained in:
jonpas 2015-08-17 01:24:45 +02:00
parent 68489c456e
commit 68370f63d7
2 changed files with 16 additions and 10 deletions

View File

@ -18,13 +18,6 @@
exceptions[] = {"isNotInside"}; \ exceptions[] = {"isNotInside"}; \
icon = PATHTOF(ui\icon_refuel_interact.paa); \ 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) { \ class GVAR(Return) { \
displayName = CSTRING(Return); \ displayName = CSTRING(Return); \
condition = QUOTE([ARR_1(_player)] call FUNC(canConnectNozzle)); \ condition = QUOTE([ARR_1(_player)] call FUNC(canConnectNozzle)); \
@ -32,6 +25,13 @@
exceptions[] = {"isNotInside"}; \ exceptions[] = {"isNotInside"}; \
icon = PATHTOF(ui\icon_refuel_interact.paa); \ 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); \
}; \
}; \ }; \
}; \ }; \
}; };

View File

@ -25,9 +25,15 @@ _nozzle = _unit getVariable QGVAR(nozzle);
if (_source != _target || {isNil "_nozzle"}) exitWith {false}; if (_source != _target || {isNil "_nozzle"}) exitWith {false};
_source setVariable [QGVAR(isConnected), false, true]; _unit setVariable [QGVAR(nozzle), nil];
ropeDestroy (_nozzle getVariable QGVAR(rope)); detach _nozzle;
deleteVehicle _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]; _unit setVariable [QGVAR(isRefueling), false];
_target setVariable [QGVAR(isConnected), false, true];
ropeDestroy (_nozzle getVariable QGVAR(rope));
deleteVehicle _nozzle;
true true