public void GetFreePlayers(ref List <IMyPlayer> result) { BoundingBoxD box = MainGrid.GetPhysicalGroupAABB(); if (result == null) { result = new List <IMyPlayer>(); } else { result.Clear(); } MyAPIGateway.Players.GetPlayers(result, HasPlayer); for (int i = result.Count - 1; i >= 0; i--) { if (box.Contains(result [i].Character.GetPosition()) == ContainmentType.Disjoint) { result.RemoveAtFast(i); } } }