2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-13 17:33:55 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
2023-02-17 02:06:11 +00:00
|
|
|
* Disconnects a fuel nozzle and makes unit pick it up.
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
2023-02-17 02:06:11 +00:00
|
|
|
* 0: Unit <OBJECT> (default: objNull)
|
2015-08-20 20:10:26 +00:00
|
|
|
* 1: Nozzle <OBJECT>
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-14 01:18:54 +00:00
|
|
|
* None
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-21 20:43:45 +00:00
|
|
|
* [player, nozzle] call ace_refuel_fnc_disconnect
|
2015-08-13 17:33:55 +00:00
|
|
|
*
|
2015-08-14 01:18:54 +00:00
|
|
|
* Public: No
|
2015-08-13 17:33:55 +00:00
|
|
|
*/
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
|
2015-08-13 17:33:55 +00:00
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
private _sink = _nozzle getVariable [QGVAR(sink), objNull];
|
2015-08-20 20:10:26 +00:00
|
|
|
if (isNull _sink) exitWith {};
|
2015-08-13 17:33:55 +00:00
|
|
|
|
2017-09-10 19:43:03 +00:00
|
|
|
_sink setVariable [QGVAR(nozzle), nil, true];
|
2017-09-16 09:36:42 +00:00
|
|
|
if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), true, true]; };
|
2017-09-10 19:43:03 +00:00
|
|
|
_nozzle setVariable [QGVAR(sink), nil, true];
|
2015-08-22 11:34:24 +00:00
|
|
|
_nozzle setVariable [QGVAR(isConnected), false, true];
|
|
|
|
[objNull, _nozzle, true] call FUNC(dropNozzle);
|
2015-08-13 17:33:55 +00:00
|
|
|
|
2023-02-17 02:06:11 +00:00
|
|
|
if (!isNull _unit) then {
|
|
|
|
[_unit, _nozzle] call FUNC(takeNozzle);
|
|
|
|
};
|