ACE3/addons/headless/functions/fnc_handleConnectHC.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

36 lines
757 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Jonpas
* Registers connected Headless Client for use.
*
* Arguments:
* 0: Headless Client <OBJECT>
*
* Return Value:
* None
*
* Example:
* [headlessClient] call ace_headless_fnc_handleConnectHC
*
* Public: No
*/
params ["_headlessClient"];
// Exit if HC already registered
// No need to check if distribution or end mission enabled, as if disabled this will never run
if (_headlessClient in GVAR(headlessClients)) exitWith {};
// Register for use
GVAR(headlessClients) pushBack _headlessClient;
if (XGVAR(log)) then {
INFO_1("Registered HC: %1",_headlessClient);
};
// Exit if AI distribution is disabled
if (!XGVAR(enabled)) exitWith {true};
// Rebalance
[true] call FUNC(rebalance);