Release parking slots when capture occurs

This commit is contained in:
Raffson 2023-09-02 22:37:29 +02:00
parent 66d741d0b3
commit e4cb0f7c28
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 9 additions and 0 deletions

View File

@ -25,6 +25,7 @@
* **[Data]** Corrected the class of the USS Samuel Chase from Logistics to LandingShip, in order to prevent it being spawned as part of AAA sites.
* **[Mission Generation]** Helicopters oscillating due to over-speeding
* **[Mission Generation]** Fix infinite loop when using "Fast-Forward to first contact"
* **[Capture Logic]** Release all parking slots when an airbase is captured
# Retribution v1.2.1 (hotfix)

View File

@ -906,12 +906,16 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
if not tgo.capturable:
tgo.clear()
def release_parking_slots(self) -> None:
pass
# TODO: Should be Airbase specific.
def capture(self, game: Game, events: GameUpdateEvents, for_player: bool) -> None:
new_coalition = game.coalition_for(for_player)
self.ground_unit_orders.refund_all(self.coalition)
self.retreat_ground_units(game)
self.retreat_air_units(game)
self.release_parking_slots()
self.depopulate_uncapturable_tgos()
self._coalition = new_coalition
self.base.set_strength_to_minimum()
@ -1232,6 +1236,10 @@ class Airfield(ControlPoint, CTLD):
parking_slots += len(self.airport.parking_slots)
return parking_slots
def release_parking_slots(self) -> None:
for slot in self.parking_slots:
slot.unit_id = None
@property
def heading(self) -> Heading:
return Heading.from_degrees(self.airport.runways[0].heading)