fn_addDead.sqf 553 B

123456789101112131415161718192021
  1. _obj = _this;
  2. AW_dead = AW_dead + [_obj];
  3. if ((count AW_dead) > PARAMS_bodyLimit) then
  4. {
  5. while { (count AW_dead) > PARAMS_bodyLimit } do
  6. {
  7. _deadThing = AW_dead select 0;
  8. _group = group _deadThing;
  9. deleteVehicle _deadThing;
  10. _canDeleteGroup = true;
  11. {
  12. if (!isNull _x && alive _x) exitWith { _canDeleteGroup = false; };
  13. } forEach (units _group);
  14. if (_canDeleteGroup) then { deleteGroup _group; };
  15. //Is this necessary? Does the object get automatically deleted from the array?
  16. AW_dead = [AW_dead, 0] call BIS_fnc_removeIndex;
  17. };
  18. };