ACE3/addons/refuel/functions/fnc_handleDisconnect.sqf
jonpas 742626ff1a
General - Relative script_component.hpp includes (#9378)
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-09-12 20:58:10 +02:00

28 lines
569 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: GitHawk
* Cleans up refuel on client disconnect.
*
* Arguments:
* 0: Player <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player] call ace_refuel_fnc_handleDisconnect
*
* Public: No
*/
params [["_unit", objNull, [objNull]]];
TRACE_1("disconnect",_unit);
if (isNull _unit) exitWith {};
private _nozzle = _unit getVariable [QGVAR(nozzle), objNull];
if (isNull _nozzle) exitWith {};
[_unit, _nozzle] call FUNC(dropNozzle);
[_unit, "forceWalk", "ACE_refuel", false] call EFUNC(common,statusEffect_set);