ACE3/addons/refuel/functions/fnc_disconnect.sqf

31 lines
771 B
Plaintext
Raw Normal View History

2015-08-13 17:33:55 +00:00
/*
* Author: GitHawk
2015-08-20 20:10:26 +00:00
* Disconnect a fuel nozzle.
2015-08-13 17:33:55 +00:00
*
* Arguments:
2015-08-20 20:10:26 +00:00
* 0: Unit <OBJECT>
* 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
*/
#include "script_component.hpp"
params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
2015-08-13 17:33:55 +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
_sink setVariable [QGVAR(nozzle), nil, true];
if (_nozzle isKindOf "Land_CanisterFuel_F") then { _nozzle setVariable [QEGVAR(cargo,canLoad), true, true]; };
_nozzle setVariable [QGVAR(sink), nil, true];
_nozzle setVariable [QGVAR(isConnected), false, true];
[objNull, _nozzle, true] call FUNC(dropNozzle);
2015-08-13 17:33:55 +00:00
[_unit, _nozzle] call FUNC(takeNozzle);