mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix SEAD Sweep not available at campaign start
This commit is contained in:
parent
02ae5d9ad7
commit
63e2c30e44
@ -1,4 +1,4 @@
|
||||
from .flight import Flight
|
||||
from .flighttype import FlightType
|
||||
from .flight import Flight
|
||||
from .flightwaypoint import FlightWaypoint
|
||||
from .package import Package
|
||||
|
||||
@ -15,6 +15,7 @@ from dcs.unitpropertydescription import UnitPropertyDescription
|
||||
from dcs.unittype import FlyingType
|
||||
from dcs.weapons_data import weapon_ids
|
||||
|
||||
from game.ato import FlightType
|
||||
from game.data.units import UnitClass
|
||||
from game.dcs.lasercodeconfig import LaserCodeConfig
|
||||
from game.dcs.unittype import UnitType
|
||||
@ -54,7 +55,6 @@ from game.utils import (
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game.ato import FlightType
|
||||
from game.missiongenerator.aircraft.flightdata import FlightData
|
||||
from game.missiongenerator.missiondata import MissionData
|
||||
from game.radio.radios import Radio, RadioFrequency, RadioRegistry
|
||||
@ -217,6 +217,13 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
||||
list
|
||||
)
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
enrich = {}
|
||||
for t in self.task_priorities:
|
||||
if t == FlightType.SEAD:
|
||||
enrich[FlightType.SEAD_SWEEP] = self.task_priorities[t]
|
||||
self.task_priorities.update(enrich)
|
||||
|
||||
@classmethod
|
||||
def register(cls, unit_type: AircraftType) -> None:
|
||||
cls._by_name[unit_type.variant_id] = unit_type
|
||||
|
||||
@ -152,8 +152,6 @@ class Migrator:
|
||||
if isinstance(s.country, str):
|
||||
c = country_dict.get(s.country, s.country)
|
||||
s.country = countries_by_name[c]()
|
||||
if FlightType.SEAD in s.auto_assignable_mission_types:
|
||||
s.auto_assignable_mission_types.add(FlightType.SEAD_SWEEP)
|
||||
|
||||
# code below is used to fix corruptions wrt overpopulation
|
||||
parking_type = ParkingType().from_squadron(s)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user