Fix F_createManagedUnit changing side of target group
This commit is contained in:
parent
979105a05e
commit
5a7d47e23a
|
@ -30,10 +30,18 @@ params [
|
|||
["_placement", 0, [0]]
|
||||
];
|
||||
|
||||
private _unit = _group createUnit [_type, _spawnPos, [], _placement, "FORM"];
|
||||
// Create temp group, as we need to let the unit join the "correct side group".
|
||||
// If we use the "correct side group" for the createUnit, the group would switch to the side of the unit written in the config.
|
||||
private _groupTemp = createGroup [CIVILIAN, true];
|
||||
|
||||
private _unit = _groupTemp createUnit [_type, _spawnPos, [], _placement, "FORM"];
|
||||
_unit addMPEventHandler ["MPKilled", {_this spawn kill_manager}];
|
||||
_unit setRank _rank;
|
||||
|
||||
// Joint to target group to preserve Side
|
||||
[_unit] joinSilent _group;
|
||||
deleteGroup _groupTemp;
|
||||
|
||||
// Process KP object init
|
||||
[_unit] call F_addObjectInit;
|
||||
|
||||
|
|
Loading…
Reference in New Issue