Ability to disable cargo-ships

Fix #76
This commit is contained in:
Raffson 2023-09-09 12:09:57 +02:00
parent 0cb3702eb9
commit e50d49d7ba
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 10 additions and 3 deletions

View File

@ -24,9 +24,10 @@ class CargoShipGenerator:
def generate(self) -> None:
# Reset the count to make generation deterministic.
for coalition in self.game.coalitions:
for ship in coalition.transfers.cargo_ships:
self.generate_cargo_ship(ship)
if not self.game.settings.perf_disable_cargo_ships:
for coalition in self.game.coalitions:
for ship in coalition.transfers.cargo_ships:
self.generate_cargo_ship(ship)
def generate_cargo_ship(self, ship: CargoShip) -> ShipGroup:
waypoints = ship.route

View File

@ -797,6 +797,12 @@ class Settings:
section=PERFORMANCE_SECTION,
default=False,
)
perf_disable_cargo_ships: bool = boolean_option(
"Disable shipping-convoys",
page=MISSION_GENERATOR_PAGE,
section=PERFORMANCE_SECTION,
default=False,
)
perf_frontline_units_prefer_roads: bool = boolean_option(
"Front line troops prefer roads",
page=MISSION_GENERATOR_PAGE,