diff --git a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf index 99f007d..e0aed31 100644 --- a/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf +++ b/@ExileServer/addons/a3_dms/scripts/OnKilled.sqf @@ -80,6 +80,14 @@ if(DMS_RemoveNVG) then _unit unlinkItem "NVGoggles"; }; +// credit: https://github.com/SMVampire/VEMF/ +if (((count (units group _unit)) > 1) && {(leader group _unit) == _unit}) then +{ + _grpUnits = units group _unit; + _grpUnits = _grpUnits - [_unit]; + (group _unit) selectLeader (_grpUnits call BIS_fnc_selectRandom); +}; + if ((!isNull _playerObj) && {(getPlayerUID _playerObj) != ""}) then