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

@@ -4,7 +4,6 @@ import itertools
from typing import TYPE_CHECKING
from dcs import Mission
from dcs.ships import HandyWind
from dcs.unitgroup import ShipGroup
from game.transfers import CargoShip
@@ -30,15 +29,16 @@ class CargoShipGenerator:
self.generate_cargo_ship(ship)
def generate_cargo_ship(self, ship: CargoShip) -> ShipGroup:
coalition = self.game.coalition_for(ship.player_owned)
waypoints = ship.route
country = self.game.coalition_for(ship.player_owned).faction.country
country = coalition.faction.country
country = self.mission.country(country.name)
group = self.mission.ship_group(
country,
ship.name,
HandyWind,
coalition.faction.cargo_ship.dcs_unit_type,
position=waypoints[0],
group_size=1,
)