mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fixed not all generated flights getting inserted into Pretense data structures.
This commit is contained in:
parent
064d17aab0
commit
5fa7757ae1
@ -556,9 +556,9 @@ class PretenseAircraftGenerator:
|
||||
StartType.COLD,
|
||||
divert=cp,
|
||||
)
|
||||
for pilot in flight.roster.pilots:
|
||||
if pilot is not None:
|
||||
pilot.player = True
|
||||
for roster_pilot in flight.roster.pilots:
|
||||
if roster_pilot is not None:
|
||||
roster_pilot.player = True
|
||||
print(
|
||||
f"Generated flight for {squadron.primary_task} flying {squadron.aircraft.name} at {squadron.location.name}. Pilot client count: {flight.client_count}"
|
||||
)
|
||||
|
||||
@ -128,6 +128,10 @@ class PretenseFlightGroupSpawner(FlightGroupSpawner):
|
||||
if pad_group is not None:
|
||||
return pad_group
|
||||
if cp.has_ground_spawns and (self.flight.client_count > 0 or is_heli):
|
||||
if self.flight.client_count == 0:
|
||||
self.flight.coalition.game.pretense_air[cp_side][
|
||||
cp_name_trimmed
|
||||
][self.flight.flight_type].append(name)
|
||||
pad_group = self._generate_at_cp_ground_spawn(name, cp)
|
||||
if pad_group is not None:
|
||||
return pad_group
|
||||
@ -139,6 +143,10 @@ class PretenseFlightGroupSpawner(FlightGroupSpawner):
|
||||
elif isinstance(cp, Airfield):
|
||||
is_heli = self.flight.squadron.aircraft.helicopter
|
||||
if cp.has_helipads and is_heli:
|
||||
if self.flight.client_count == 0:
|
||||
self.flight.coalition.game.pretense_air[cp_side][
|
||||
cp_name_trimmed
|
||||
][self.flight.flight_type].append(name)
|
||||
pad_group = self._generate_at_cp_helipad(name, cp)
|
||||
if pad_group is not None:
|
||||
return pad_group
|
||||
@ -149,6 +157,10 @@ class PretenseFlightGroupSpawner(FlightGroupSpawner):
|
||||
>= self.flight.count
|
||||
and (self.flight.client_count > 0 or is_heli)
|
||||
):
|
||||
if self.flight.client_count == 0:
|
||||
self.flight.coalition.game.pretense_air[cp_side][
|
||||
cp_name_trimmed
|
||||
][self.flight.flight_type].append(name)
|
||||
pad_group = self._generate_at_cp_ground_spawn(name, cp)
|
||||
if pad_group is not None:
|
||||
return pad_group
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user