Avoid overpopulating bases

With the new aircraft limitations for squadrons, airfields/fobs/farps could get overpopulated at campaign start. This would cause all sorts of gnarly things like squadrons ending up with a negative amount of "owned aircraft".
This commit is contained in:
Raffson 2023-05-28 14:28:41 +02:00
parent 35607515f6
commit b958e9b095
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 3 additions and 2 deletions

View File

@ -259,7 +259,8 @@ class Settings:
default=False,
detail=(
"If set, squadrons will not be able to exceed a maximum number of aircraft "
"(configurable), and the campaign will begin with all squadrons at full strength."
"(configurable), and the campaign will begin with all squadrons at full strength "
"given enough room at the base."
),
)

View File

@ -167,7 +167,7 @@ class Squadron:
raise ValueError("Squadrons can only be created with active pilots.")
self._recruit_pilots(self.settings.squadron_pilot_limit)
if squadrons_start_full:
self.owned_aircraft = self.max_size
self.owned_aircraft = min(self.max_size, self.location.unclaimed_parking())
def end_turn(self) -> None:
if self.destination is not None: