Update heading and iads state of TGO after capture

This commit is contained in:
RndName 2022-05-06 15:48:22 +02:00
parent 9e3edd7208
commit 2d39fb496c
No known key found for this signature in database
GPG Key ID: 5EF516FD9537F7C0

View File

@ -63,7 +63,9 @@ from .frontline import FrontLine
from .missiontarget import MissionTarget
from .theatergroundobject import (
GenericCarrierGroundObject,
IadsGroundObject,
TheaterGroundObject,
VehicleGroupGroundObject,
)
from .theatergroup import TheaterUnit
from ..ato.starttype import StartType
@ -828,18 +830,24 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
self.retreat_ground_units(game)
self.retreat_air_units(game)
self.depopulate_uncapturable_tgos()
# All the attached TGOs have either been depopulated or captured. Tell the UI to
# update their state.
for tgo in self.connected_objectives:
events.update_tgo(tgo)
self._coalition = new_coalition
self.base.set_strength_to_minimum()
self._clear_front_lines(events)
self._create_missing_front_lines(events)
events.update_control_point(self)
# All the attached TGOs have either been depopulated or captured. Tell the UI to
# update their state. Also update orientation and IADS state for specific tgos
for tgo in self.connected_objectives:
if isinstance(tgo, IadsGroundObject) or isinstance(
tgo, VehicleGroupGroundObject
):
if isinstance(tgo, IadsGroundObject):
game.theater.iads_network.update_tgo(tgo)
conflict_heading = game.theater.heading_to_conflict_from(tgo.position)
tgo.rotate(conflict_heading or tgo.heading)
events.update_tgo(tgo)
@property
def required_aircraft_start_type(self) -> Optional[StartType]:
return None