Allow factions to specify their cargo ship type.

https://github.com/dcs-liberation/dcs_liberation/issues/3039
This commit is contained in:
Dan Albert
2023-06-26 21:30:44 -07:00
committed by Raffson
parent d3b0ae30eb
commit a343bdef23
3 changed files with 13 additions and 4 deletions

View File

@@ -45,6 +45,9 @@ class Faction:
#: choose the default locale.
locales: Optional[List[str]]
# The unit type to spawn for cargo shipping.
cargo_ship: ShipUnitType
# Country used by this faction
country: Country
@@ -194,7 +197,11 @@ class Faction:
"country ID"
) from ex
faction = Faction(locales=json.get("locales"), country=country)
faction = Faction(
locales=json.get("locales"),
country=country,
cargo_ship=ShipUnitType.named(json.get("cargo_ship", "Handy Wind"))
)
faction.name = json.get("name", "")
if not faction.name: