mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Rename faction.aircrafts -> faction.all_aircraft
This commit is contained in:
@@ -98,7 +98,7 @@ class DefaultSquadronAssigner:
|
||||
)
|
||||
return None
|
||||
|
||||
if aircraft not in self.coalition.faction.aircrafts:
|
||||
if aircraft not in self.coalition.faction.all_aircrafts:
|
||||
return None
|
||||
|
||||
lo = self.coalition.faction.liveries_overrides
|
||||
|
||||
@@ -25,7 +25,7 @@ class SquadronDefGenerator:
|
||||
) -> Optional[SquadronDef]:
|
||||
aircraft_choice: Optional[AircraftType] = None
|
||||
for aircraft in AircraftType.priority_list_for_task(task):
|
||||
if aircraft not in self.faction.aircrafts:
|
||||
if aircraft not in self.faction.all_aircrafts:
|
||||
continue
|
||||
if not control_point.can_operate(aircraft):
|
||||
continue
|
||||
|
||||
@@ -180,7 +180,7 @@ class Faction:
|
||||
return sorted(air_defenses)
|
||||
|
||||
@cached_property
|
||||
def aircrafts(self) -> list[UnitType[Any]]:
|
||||
def all_aircrafts(self) -> list[UnitType[Any]]:
|
||||
# Migrator can't cope with this, so we need to do it here...
|
||||
self.aircraft = set(self.aircraft)
|
||||
self.awacs = set(self.awacs)
|
||||
@@ -537,14 +537,14 @@ class Faction:
|
||||
self.remove_ship("Destroyer_carrier")
|
||||
|
||||
def remove_aircraft(self, name: str) -> None:
|
||||
for i in list(self.aircrafts):
|
||||
for i in list(self.all_aircrafts):
|
||||
if i.dcs_unit_type.id == name:
|
||||
self.aircrafts.remove(i)
|
||||
self.all_aircrafts.remove(i)
|
||||
|
||||
def remove_aircraft_by_name(self, name: str) -> None:
|
||||
for i in list(self.aircrafts):
|
||||
for i in list(self.all_aircrafts):
|
||||
if i.display_name == name:
|
||||
self.aircrafts.remove(i)
|
||||
self.all_aircrafts.remove(i)
|
||||
|
||||
def remove_preset(self, name: str) -> None:
|
||||
for pg in self.preset_groups:
|
||||
|
||||
@@ -61,7 +61,7 @@ class ProcurementAi:
|
||||
return 0
|
||||
|
||||
# faction has no planes or no squadrons
|
||||
if len(self.faction.aircrafts) == 0 or len(self.air_wing.squadrons) == 0:
|
||||
if len(self.faction.all_aircrafts) == 0 or len(self.air_wing.squadrons) == 0:
|
||||
return 1
|
||||
|
||||
parking_type = ParkingType(
|
||||
|
||||
@@ -38,7 +38,7 @@ class SquadronDefLoader:
|
||||
f"{squadron_def.country.name}, need {country.name}: {path}"
|
||||
)
|
||||
continue
|
||||
if squadron_def.aircraft not in faction.aircrafts:
|
||||
if squadron_def.aircraft not in faction.all_aircrafts:
|
||||
logging.debug(
|
||||
f"Not using squadron because {faction.name} cannot use "
|
||||
f"{squadron_def.aircraft}: {path}"
|
||||
|
||||
Reference in New Issue
Block a user