mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
39 lines
1010 B
Plaintext
39 lines
1010 B
Plaintext
/*
|
|
Author: IT07
|
|
|
|
Description:
|
|
this function makes sure that AI spawned by VEMF does NOT become local to the server.
|
|
On detection of a local group, it will reassign it to a client or Headless Client if enabled.
|
|
|
|
Params:
|
|
none, this is a Standalone function
|
|
|
|
Returns:
|
|
nothing
|
|
*/
|
|
|
|
[] spawn
|
|
{
|
|
uiNamespace setVariable ["VEMFrHcLoad", []];
|
|
uiNamespace setVariable ["vemfGroups", []];
|
|
while {true} do
|
|
{
|
|
_groups = uiNamespace getVariable "vemfGroups";
|
|
waitUntil { uiSleep 1; count _groups > 0 };
|
|
{
|
|
if (local _x) then
|
|
{
|
|
if ((count units _x) < 1) then
|
|
{
|
|
deleteGroup _x;
|
|
};
|
|
if (count (units _x) > 0) then
|
|
{
|
|
// Group still has units, check if there is anyone that can be the owner
|
|
[_x] call VEMFr_fnc_transferOwner;
|
|
};
|
|
};
|
|
} forEach _groups;
|
|
};
|
|
};
|