mirror of
https://github.com/IT07/a3_vemf_reloaded.git
synced 2024-08-30 16:52:11 +00:00
Rewritten, tweaked and fixed
This commit is contained in:
parent
9a09a8795e
commit
86dd2b7404
@ -13,23 +13,26 @@
|
||||
*/
|
||||
|
||||
uiNamespace setVariable ["VEMFrHcLoad", []];
|
||||
uiNamespace setVariable ["VEMFrAIgroups", []];
|
||||
while {true} do
|
||||
{
|
||||
_groups = uiNamespace getVariable "VEMFrAIgroups";
|
||||
waitUntil {if (count _groups > 0) then {true} else {uiSleep 1; false} };
|
||||
{
|
||||
if (local _x) then
|
||||
if ((count playableUnits) > 0) then
|
||||
{
|
||||
waitUntil {if ((count allGroups) > 0) then {uiSleep 0.25; true} else {uiSleep 0.5; false} };
|
||||
{
|
||||
if ((count units _x) < 1) then
|
||||
if ((local _x) AND (_x getVariable ["isVEMFrGroup",false])) then
|
||||
{
|
||||
deleteGroup _x;
|
||||
if ((count (units _x)) > 0) then
|
||||
{
|
||||
["REMOTEguard",1,format["Attempting to transfer group: %1", _x]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
|
||||
// Group still has units, check if there is anyone that can be the owner
|
||||
_handle = [_x] ExecVM "exile_vemf_reloaded\sqf\setGroupOwner.sqf";
|
||||
waitUntil { if (scriptDone _handle) then {true} else {uiSleep 0.1; false} };
|
||||
["REMOTEguard",1,format["Transfer attempted. Group (%1) is %2", _x, if (local _x) then {"still local!"} else {"now REMOTE"}]] ExecVM "exile_vemf_reloaded\sqf\log.sqf";
|
||||
} else
|
||||
{
|
||||
deleteGroup _x;
|
||||
};
|
||||
};
|
||||
if (count (units _x) > 0) then
|
||||
{
|
||||
// Group still has units, check if there is anyone that can be the owner
|
||||
[_x] ExecVM "exile_vemf_reloaded\sqf\transferOwner.sqf";
|
||||
};
|
||||
};
|
||||
} forEach _groups;
|
||||
} forEach allGroups;
|
||||
} else { uiSleep 5 };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user