From c5897950b6d0071aaff80e2b771e8501e24468c5 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sat, 6 Apr 2024 17:39:27 +0200 Subject: [PATCH] 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". --- changelog.md | 1 + game/theater/iadsnetwork/iadsnetwork.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/changelog.md b/changelog.md index fe721d3f..ba320026 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/game/theater/iadsnetwork/iadsnetwork.py b/game/theater/iadsnetwork/iadsnetwork.py index 85bf9deb..21e5f663 100644 --- a/game/theater/iadsnetwork/iadsnetwork.py +++ b/game/theater/iadsnetwork/iadsnetwork.py @@ -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):