mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Made return nozzle bypass connect-attach
This commit is contained in:
parent
b717ff8dde
commit
40eb5a5ba9
@ -25,10 +25,10 @@
|
||||
exceptions[] = {"isNotInside"}; \
|
||||
icon = PATHTOF(ui\icon_refuel_interact.paa); \
|
||||
}; \
|
||||
class GVAR(Connect) { \
|
||||
class GVAR(Return) { \
|
||||
displayName = CSTRING(Return); \
|
||||
condition = QUOTE([ARR_1(_player)] call FUNC(canConnectNozzle)); \
|
||||
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(connectNozzle)); \
|
||||
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(returnNozzle)); \
|
||||
exceptions[] = {"isNotInside"}; \
|
||||
icon = PATHTOF(ui\icon_refuel_interact.paa); \
|
||||
}; \
|
||||
|
@ -13,6 +13,7 @@ PREP(connectNozzleAction);
|
||||
PREP(disconnect);
|
||||
PREP(getFuel);
|
||||
PREP(moduleRefuelSettings);
|
||||
PREP(returnNozzle);
|
||||
PREP(setFuel);
|
||||
PREP(takeNozzle);
|
||||
PREP(turnOff);
|
||||
|
@ -81,14 +81,6 @@ _weaponSelect = _unit getVariable QGVAR(selectedWeaponOnRefuel);
|
||||
_unit selectWeapon _weaponSelect;
|
||||
_unit setVariable [QGVAR(selectedWeaponOnRefuel), nil];
|
||||
|
||||
_source = _nozzle getVariable QGVAR(source);
|
||||
if (_source == _target) exitWith {
|
||||
_source setVariable [QGVAR(isConnected), false, true];
|
||||
ropeDestroy (_nozzle getVariable QGVAR(rope));
|
||||
deleteVehicle _nozzle;
|
||||
_unit setVariable [QGVAR(isRefueling), false];
|
||||
};
|
||||
|
||||
_nozzle attachTo [_target, _endPosTestOffset];
|
||||
_nozzle setVariable [QGVAR(sink), _target, true];
|
||||
_nozzle setVariable [QGVAR(fueling), 1, true];
|
||||
@ -96,4 +88,4 @@ _target setVariable [QGVAR(nozzle), _nozzle, true];
|
||||
|
||||
[_unit, _target, _nozzle] call FUNC(refuel);
|
||||
|
||||
true
|
||||
true
|
||||
|
33
addons/refuel/functions/fnc_returnNozzle.sqf
Normal file
33
addons/refuel/functions/fnc_returnNozzle.sqf
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Author: GitHawk et.al., Jonpas
|
||||
* Returns the nozzle back to source vehicle.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Target <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Returned Nozzle <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_refuel_fnc_returnNozzle
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_nozzle"];
|
||||
|
||||
params ["_unit", "_target"];
|
||||
|
||||
_source = _nozzle getVariable QGVAR(source);
|
||||
_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(isRefueling), false];
|
||||
|
||||
true
|
Loading…
Reference in New Issue
Block a user