From 6965133a33261f139791b8570591982d12152168 Mon Sep 17 00:00:00 2001 From: Raffson Date: Sun, 12 Jan 2025 16:04:52 +0100 Subject: [PATCH] Filter "self" when ground units retreat from CP Fixes an infinite loop in case a connection to the same CP is made in the template miz file of the campaign. It's basically wrong input, but suppose we'd have a use-case for it in the future, it would still make sense to have ground units retreat to a CP that's different from their origin... --- game/theater/controlpoint.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index f52be7a7..d9555301 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -41,8 +41,6 @@ from dcs.ships import ( Type_071, hms_invincible, ) -from pydcs_extensions.vietnamwarvessels import Cva_31 - from dcs.terrain.terrain import Airport, ParkingSlot from dcs.unitgroup import ShipGroup, StaticGroup from dcs.unittype import ShipType @@ -63,7 +61,7 @@ from game.sidc import ( ) from game.theater.presetlocation import PresetLocation from game.utils import Distance, Heading, meters -from pydcs_extensions import L02, L52, L61 +from pydcs_extensions import L02, L52, L61, Cva_31 from .base import Base from .frontline import FrontLine from .interfaces.CTLD import CTLD @@ -837,7 +835,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC): destinations = [ GroundUnitDestination(cp) for cp in self.connected_points - if cp.captured == self.captured + if cp.captured == self.captured and cp is not self ] if not destinations: self.capture_equipment(game)