mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Allow players to be defined in the squadron file.
https://github.com/dcs-liberation/dcs_liberation/issues/276
This commit is contained in:
parent
f36757b650
commit
82ce688a0d
@ -112,6 +112,9 @@ class Squadron:
|
|||||||
if unit_type is None:
|
if unit_type is None:
|
||||||
raise KeyError(f"Could not find any aircraft with the ID {unit_type}")
|
raise KeyError(f"Could not find any aircraft with the ID {unit_type}")
|
||||||
|
|
||||||
|
pilots = [Pilot(n, player=False) for n in data.get("pilots", [])]
|
||||||
|
pilots.extend([Pilot(n, player=True) for n in data.get("players", [])])
|
||||||
|
|
||||||
return Squadron(
|
return Squadron(
|
||||||
name=data["name"],
|
name=data["name"],
|
||||||
nickname=data["nickname"],
|
nickname=data["nickname"],
|
||||||
@ -120,7 +123,7 @@ class Squadron:
|
|||||||
aircraft=unit_type,
|
aircraft=unit_type,
|
||||||
livery=data.get("livery"),
|
livery=data.get("livery"),
|
||||||
mission_types=tuple(FlightType.from_name(n) for n in data["mission_types"]),
|
mission_types=tuple(FlightType.from_name(n) for n in data["mission_types"]),
|
||||||
pilots=[Pilot(n) for n in data.get("pilots", [])],
|
pilots=pilots,
|
||||||
game=game,
|
game=game,
|
||||||
player=player,
|
player=player,
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user