Skip dead connections in IADS network

The "no skynet usable units" exception would get triggered when an IADS-node would form its connections. If one of those connections contained an IADS unit that was dead, the exception would get triggered since we weren't skipping "dead connections".
This commit is contained in:
Raffson
2024-04-06 17:39:27 +02:00
parent d4234dd7b3
commit c5897950b6
2 changed files with 3 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
## Fixes
* **[UI/UX]** A-10A flights can be edited again.
* **[Mission Generation]** IADS bug sometimes triggering "no skynet usable units" error during mission generation
# Retribution v1.3.1

View File

@@ -130,6 +130,8 @@ class IadsNetwork:
# but if it does, we want to know because it's supposed to be impossible afaict
skynet_node = SkynetNode.from_group(node.group)
for connection in node.connections.values():
if not any([x.alive for x in connection.units]):
continue
if connection.ground_object.is_friendly(
skynet_node.player
) and not game.iads_considerate_culling(connection.ground_object):