mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix spawning unused aircraft.
These are assigned a squadron even though they're unused as a hack. We need to tolerate these aircraft having no pilot assigned since that's the desired case for unused aircraft (though only happens when the squadron runs out of pilots, which should be fixed).
This commit is contained in:
@@ -19,7 +19,7 @@ from gen.flights.flight import Flight
|
||||
@dataclass(frozen=True)
|
||||
class FlyingUnit:
|
||||
flight: Flight
|
||||
pilot: Pilot
|
||||
pilot: Optional[Pilot]
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -70,8 +70,6 @@ class UnitMap:
|
||||
name = str(unit.name)
|
||||
if name in self.aircraft:
|
||||
raise RuntimeError(f"Duplicate unit name: {name}")
|
||||
if pilot is None:
|
||||
raise ValueError(f"{name} has no pilot assigned")
|
||||
self.aircraft[name] = FlyingUnit(flight, pilot)
|
||||
if flight.cargo is not None:
|
||||
self.add_airlift_units(group, flight.cargo)
|
||||
|
||||
Reference in New Issue
Block a user