From 055519411b804233b1b77e43ea663fe4dd135ac9 Mon Sep 17 00:00:00 2001 From: Raffson Date: Mon, 5 Jun 2023 21:09:38 +0200 Subject: [PATCH] Apparently stances use the connected CP's ID -_- --- game/ground_forces/ai_ground_planner.py | 3 +-- game/theater/controlpoint.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/game/ground_forces/ai_ground_planner.py b/game/ground_forces/ai_ground_planner.py index 655244a1..86dc8f60 100644 --- a/game/ground_forces/ai_ground_planner.py +++ b/game/ground_forces/ai_ground_planner.py @@ -151,8 +151,7 @@ class GroundPlanner: while available > 0: if len(self.connected_enemy_cp) > 0: enemy_cp: ControlPoint = random.choice(self.connected_enemy_cp) - ecp_id = self.cp.front_line_with(enemy_cp).id - frontline_stance = self.cp.stances[ecp_id] + frontline_stance = self.cp.stances[enemy_cp.id] group_size_choice = GROUP_SIZES_BY_COMBAT_STANCE[frontline_stance] if role == CombatGroupRole.SHORAD: count = 1 diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index 61cf1424..dc442602 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -351,7 +351,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC): self.base: Base = Base() self.cptype = cptype # TODO: Should be Airbase specific. - self.stances: dict[UUID, CombatStance] = {} + self.stances: dict[UUID, CombatStance] = {} # Connected-CP -> CombatStance from ..groundunitorders import GroundUnitOrders self.ground_unit_orders = GroundUnitOrders(self)