From 08628db9c53a6125afb920f88542953a1951c815 Mon Sep 17 00:00:00 2001 From: Dregu Date: Fri, 24 Feb 2023 11:08:00 +0200 Subject: [PATCH] Fix build and speedrun mode (#45) * disable init in speedrun mode * fix runner? * make char json speedrun legal --- .github/workflows/CI.yml | 2 +- .github/workflows/Nightly.yml | 2 +- .github/workflows/Publish.yml | 2 +- source/playlunky/mod/mod_manager.cpp | 17 +++++++++-------- submodules/overlunky | 2 +- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 52835da..7825b21 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,7 +25,7 @@ jobs: - name: Prepare run: | python -m pip install --upgrade pip - pip install conan + pip install conan==1.59.0 - name: Cache conan uses: actions/cache@v3 diff --git a/.github/workflows/Nightly.yml b/.github/workflows/Nightly.yml index 641b10f..17e44d3 100644 --- a/.github/workflows/Nightly.yml +++ b/.github/workflows/Nightly.yml @@ -35,7 +35,7 @@ jobs: - name: Prepare run: | python -m pip install --upgrade pip - pip install conan + pip install conan==1.59.0 - name: Cache conan uses: actions/cache@v3 diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index f0ac481..45c7ae5 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -26,7 +26,7 @@ jobs: - name: Prepare run: | python -m pip install --upgrade pip - pip install conan + pip install conan==1.59.0 - name: Cache conan uses: actions/cache@v3 diff --git a/source/playlunky/mod/mod_manager.cpp b/source/playlunky/mod/mod_manager.cpp index e0e899a..84f68f5 100644 --- a/source/playlunky/mod/mod_manager.cpp +++ b/source/playlunky/mod/mod_manager.cpp @@ -900,6 +900,13 @@ ModManager::~ModManager() void ModManager::PostGameInit(const class PlaylunkySettings& settings) { + const bool speedrun_mode = settings.GetBool("general_settings", "speedrun_mode", false); + + PatchCharacterDefinitions(mVfs, settings); + + if (speedrun_mode) + return; + Spelunky_InitState(); const auto db_folder = mModsRoot / ".db"; @@ -911,8 +918,6 @@ void ModManager::PostGameInit(const class PlaylunkySettings& settings) mSpritePainter->FinalizeSetup(db_original_folder, db_folder); } - PatchCharacterDefinitions(mVfs, settings); - // Sound manager has to be initialized before any scripts Spelunky_InitSoundManager([](const char* file_path) { @@ -925,12 +930,8 @@ void ModManager::PostGameInit(const class PlaylunkySettings& settings) .data_size{ buffer.DataSize } }; }); - const bool speedrun_mode = settings.GetBool("general_settings", "speedrun_mode", false); - if (!speedrun_mode) - { - // Bugfixes may use scripts for some functionality - BugFixesInit(settings, db_folder, db_original_folder); - } + // Bugfixes may use scripts for some functionality + BugFixesInit(settings, db_folder, db_original_folder); mScriptManager.CommitScripts(settings); diff --git a/submodules/overlunky b/submodules/overlunky index 922cfa4..282ae20 160000 --- a/submodules/overlunky +++ b/submodules/overlunky @@ -1 +1 @@ -Subproject commit 922cfa4fd5ea20d08db9d4a8733151c06279a00e +Subproject commit 282ae20696e15ab18dc7803486f798d27fd12589