Cleaned up some of my recent Pretense code.

This commit is contained in:
MetalStormGhost 2023-09-10 14:09:24 +03:00
parent d09cb70948
commit 94d755e9a0
3 changed files with 4 additions and 7 deletions

View File

@ -132,7 +132,7 @@ class PretenseAircraftGenerator:
flight_type = FlightType.TRANSPORT flight_type = FlightType.TRANSPORT
elif ( elif (
FlightType.SEAD in mission_types FlightType.SEAD in mission_types
or FlightType.SEAD_SWEEP or FlightType.SEAD_SWEEP in mission_types
or FlightType.SEAD_ESCORT in mission_types or FlightType.SEAD_ESCORT in mission_types
) and num_of_sead < 2: ) and num_of_sead < 2:
flight_type = FlightType.SEAD flight_type = FlightType.SEAD

View File

@ -258,9 +258,6 @@ class PretenseMissionGenerator:
continue continue
flight.aircraft_type.assign_channels_for_flight(flight, self.mission_data) flight.aircraft_type.assign_channels_for_flight(flight, self.mission_data)
if self.game.settings.plugins.get("ewrj"):
self._configure_ewrj(aircraft_generator)
def notify_info_generators( def notify_info_generators(
self, self,
) -> None: ) -> None:

View File

@ -141,7 +141,7 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator):
cp_name: str, cp_name: str,
group_role: str, group_role: str,
max_num: int, max_num: int,
): ) -> None:
if self.ground_object.coalition.faction.has_access_to_unit_class(unit_class): if self.ground_object.coalition.faction.has_access_to_unit_class(unit_class):
unit_type = self.ground_unit_of_class(unit_class) unit_type = self.ground_unit_of_class(unit_class)
if unit_type is not None and len(vehicle_units) < max_num: if unit_type is not None and len(vehicle_units) < max_num:
@ -169,8 +169,8 @@ class PretenseGroundObjectGenerator(GroundObjectGenerator):
if self.culled: if self.culled:
return return
for group in self.ground_object.groups: for group in self.ground_object.groups:
vehicle_units = [] vehicle_units: list[TheaterUnit] = []
ship_units = [] ship_units: list[TheaterUnit] = []
# Split the different unit types to be compliant to dcs limitation # Split the different unit types to be compliant to dcs limitation
for unit in group.units: for unit in group.units:
cp_name_trimmed = "".join( cp_name_trimmed = "".join(