2015-11-23 18:28:51 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Resets a player
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Fuel nozzle <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [nozzle] call ace_refuel_fnc_resetLocal
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
params [["_unit", objNull, [objNull]], ["_nozzle", objNull, [objNull]]];
|
2015-11-23 18:28:51 +00:00
|
|
|
|
|
|
|
if (isNull _unit ||
|
|
|
|
{isNull _nozzle} ||
|
|
|
|
{!(_unit isKindOf "CAManBase")} ||
|
|
|
|
{!local _unit}) exitWith {};
|
2016-02-02 14:03:06 +00:00
|
|
|
|
|
|
|
private _attachedNozzle = _unit getVariable [QGVAR(nozzle), nil];
|
2015-11-23 18:28:51 +00:00
|
|
|
if (isNil "_attachedNozzle") exitWith {};
|
|
|
|
|
|
|
|
if (_nozzle != _attachedNozzle) exitWith {};
|
|
|
|
|
2016-02-02 14:03:06 +00:00
|
|
|
private _actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
|
2015-11-23 18:28:51 +00:00
|
|
|
if (_actionID != -1) then {
|
|
|
|
_unit removeAction _actionID;
|
|
|
|
_unit setVariable [QGVAR(isRefueling), false, true];
|
|
|
|
_unit setVariable [QGVAR(ReleaseActionID), nil];
|
|
|
|
_unit setVariable [QGVAR(nozzle), nil];
|
|
|
|
};
|