From 6699289bf76d62394a79a42e5773d7fc77c88ca8 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 30 May 2023 21:27:39 -0700 Subject: [PATCH] Add performance option to prevent missile tasks. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2508. --- changelog.md | 1 + game/missiongenerator/tgogenerator.py | 4 ++++ game/settings/settings.py | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/changelog.md b/changelog.md index 9a758e3e..03da1769 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,7 @@ Saves from 7.x are not compatible with 8.0. ## Features/Improvements * **[Factions]** Replaced Patriot STRs "EWRs" with AN/FPS-117 for blue factions 1980 or newer. +* **[Mission Generation]** Added option to prevent scud and V2 sites from firing at the start of the mission. * **[Mission Planning]** Per-flight TOT offsets can now be set in the flight details UI. This allows individual flights to be scheduled ahead of or behind the rest of the package. ## Fixes diff --git a/game/missiongenerator/tgogenerator.py b/game/missiongenerator/tgogenerator.py index e7683f26..0fa538b1 100644 --- a/game/missiongenerator/tgogenerator.py +++ b/game/missiongenerator/tgogenerator.py @@ -315,6 +315,10 @@ class MissileSiteGenerator(GroundObjectGenerator): def generate(self) -> None: super(MissileSiteGenerator, self).generate() + + if not self.game.settings.generate_fire_tasks_for_missile_sites: + return + # Note : Only the SCUD missiles group can fire (V1 site cannot fire in game right now) # TODO : Should be pre-planned ? # TODO : Add delay to task to spread fire task over mission duration ? diff --git a/game/settings/settings.py b/game/settings/settings.py index c0c19876..0c18eaa0 100644 --- a/game/settings/settings.py +++ b/game/settings/settings.py @@ -454,6 +454,16 @@ class Settings: section=PERFORMANCE_SECTION, default=True, ) + generate_fire_tasks_for_missile_sites: bool = boolean_option( + "Generate fire tasks for missile sites", + page=MISSION_GENERATOR_PAGE, + section=PERFORMANCE_SECTION, + detail=( + "If enabled, missile sites like V2s and Scuds will fire on random targets " + "at the start of the mission." + ), + default=True, + ) perf_moving_units: bool = boolean_option( "Moving ground units", page=MISSION_GENERATOR_PAGE,