From 748a752e29e314216138d7f37619069478a6ff3a Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 27 May 2021 19:18:52 -0700 Subject: [PATCH] Fix pydcs loadout cache for command line launcher. --- qt_ui/main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qt_ui/main.py b/qt_ui/main.py index f3f058ad..cbc3f08c 100644 --- a/qt_ui/main.py +++ b/qt_ui/main.py @@ -196,6 +196,15 @@ def create_game( "Cannot generate campaign without configuring DCS Liberation. Start the UI " "for the first run configuration." ) + + # This needs to run before the pydcs payload cache is created, which happens + # extremely early. It's not a problem that we inject these paths twice because we'll + # get the same answers each time. + # + # Without this, it is not possible to use next turn (or anything that needs to check + # for loadouts) without saving the generated campaign and reloading it the normal + # way. + inject_custom_payloads(Path(persistency.base_path())) campaign = Campaign.from_json(campaign_path) generator = GameGenerator( blue,