Zeus - Fix Group Side module (#9388)

Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
johnb432 2023-09-12 17:41:38 +02:00 committed by GitHub
parent 4a12f61352
commit 119702a189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,11 +44,19 @@ if (GETVAR(_unit,ACE_isUnconscious,false) && {GETMVAR(EGVAR(medical,moveUnitsFro
_unit setVariable [QEGVAR(common,previousGroupSwitchTo), _previousGroupsList, true];
} else {
private _units = units _unit;
// Preserve assignedTeam for each unit
{
// Teams need to be gotten before removing units from group
private _teams = _units apply {
private _team = assignedTeam _x;
[_team, "MAIN"] select (_team == "")
};
{
[_x] joinSilent _newGroup;
_x assignTeam _team;
} forEach units _unit;
_x assignTeam (_teams select _forEachIndex);
} forEach _units;
deleteGroup _oldGroup;
};