mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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...
This commit is contained in:
parent
ed4961cdbc
commit
6965133a33
@ -41,8 +41,6 @@ from dcs.ships import (
|
|||||||
Type_071,
|
Type_071,
|
||||||
hms_invincible,
|
hms_invincible,
|
||||||
)
|
)
|
||||||
from pydcs_extensions.vietnamwarvessels import Cva_31
|
|
||||||
|
|
||||||
from dcs.terrain.terrain import Airport, ParkingSlot
|
from dcs.terrain.terrain import Airport, ParkingSlot
|
||||||
from dcs.unitgroup import ShipGroup, StaticGroup
|
from dcs.unitgroup import ShipGroup, StaticGroup
|
||||||
from dcs.unittype import ShipType
|
from dcs.unittype import ShipType
|
||||||
@ -63,7 +61,7 @@ from game.sidc import (
|
|||||||
)
|
)
|
||||||
from game.theater.presetlocation import PresetLocation
|
from game.theater.presetlocation import PresetLocation
|
||||||
from game.utils import Distance, Heading, meters
|
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 .base import Base
|
||||||
from .frontline import FrontLine
|
from .frontline import FrontLine
|
||||||
from .interfaces.CTLD import CTLD
|
from .interfaces.CTLD import CTLD
|
||||||
@ -837,7 +835,7 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
|||||||
destinations = [
|
destinations = [
|
||||||
GroundUnitDestination(cp)
|
GroundUnitDestination(cp)
|
||||||
for cp in self.connected_points
|
for cp in self.connected_points
|
||||||
if cp.captured == self.captured
|
if cp.captured == self.captured and cp is not self
|
||||||
]
|
]
|
||||||
if not destinations:
|
if not destinations:
|
||||||
self.capture_equipment(game)
|
self.capture_equipment(game)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user