diff --git a/game/theater/iadsnetwork/iadsnetwork.py b/game/theater/iadsnetwork/iadsnetwork.py index 6b1fdadf..4af13c9d 100644 --- a/game/theater/iadsnetwork/iadsnetwork.py +++ b/game/theater/iadsnetwork/iadsnetwork.py @@ -53,7 +53,7 @@ class SkynetNode: # Statics will be placed as dead unit return group.units[0].unit_name # If no alive unit is available and not static raise error - raise IadsNetworkException("Group has no skynet usable units") + raise IadsNetworkException(f"{group.name} has no skynet usable units") else: # Use the GroupName for SAMs, SAMAsEWR and PDs return group.group_name @@ -121,6 +121,10 @@ class IadsNetwork: # Skip culled ground objects continue + all_dead = not any([x.alive for x in node.group.units]) + if all_dead: + continue + # SkynetNode.from_group(node.group) may raise an exception # (originating from SkynetNode.dcs_name_for_group) # but if it does, we want to know because it's supposed to be impossible afaict @@ -217,7 +221,7 @@ class IadsNetwork: node: Optional[IadsNetworkNode] = None for group in tgo.groups: # TODO Cleanup - if isinstance(group, IadsGroundGroup): + if isinstance(group, IadsGroundGroup) and group.alive_units > 0: # The first IadsGroundGroup is always the primary Group if not node and group.iads_role.participate: # Primary Node