ACE3/addons/headless/functions/fnc_rebalance.sqf
johnb432 0d401b2664
Headless - Code optimisation (#9873)
* Headless optimisations

* Swapped blacklist for unitIsUAV check

* Moved UAV check

* Update addons/headless/functions/fnc_transferGroups.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/headless/functions/fnc_transferGroups.sqf

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update fnc_transferGroups.sqf

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
2024-04-04 08:01:12 -03:00

30 lines
624 B
Plaintext

#include "..\script_component.hpp"
/*
* Author: Jonpas
* Rebalance AI groups accross HCs.
*
* Arguments:
* 0: Force <BOOL>
*
* Return Value:
* None
*
* Example:
* [false] call ace_headless_fnc_rebalance
*
* Public: No
*/
params ["_force"];
TRACE_3("Rebalance",GVAR(inRebalance),GVAR(headlessClients),_force);
// Exit if waiting for rebalance or no HCs present
if (GVAR(inRebalance) || {GVAR(headlessClients) isEqualTo []}) exitWith {};
// Transfer after rebalance delay
[LINKFUNC(transferGroups), _force, XGVAR(delay)] call CBA_fnc_waitAndExecute;
// Currently in rebalance flag
GVAR(inRebalance) = true;