Restore squadrons for Essex-transformed carriers

This commit is contained in:
Raffson 2025-07-20 12:36:48 +02:00
parent c15b4ac83f
commit 0671e45dde
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -346,6 +346,7 @@ class CarrierGroundObjectGenerator(GenericCarrierGroundObjectGenerator):
[c for c in classes if c == UnitClass.AIRCRAFT_CARRIER]
):
self.game.theater.controlpoints.remove(self.control_point)
sqdrns = self.control_point.squadrons
self.control_point = EssexCarrier(
self.control_point.name,
self.control_point.position,
@ -354,6 +355,9 @@ class CarrierGroundObjectGenerator(GenericCarrierGroundObjectGenerator):
)
self.control_point.finish_init(self.game)
self.game.theater.controlpoints.append(self.control_point)
for sqdrn in sqdrns:
if sqdrn.aircraft.lha_capable:
sqdrn.location = self.control_point
class LhaGroundObjectGenerator(GenericCarrierGroundObjectGenerator):