Skip to content

Commit

Permalink
Fix build and speedrun mode (#45)
Browse files Browse the repository at this point in the history
* disable init in speedrun mode

* fix runner?

* make char json speedrun legal
  • Loading branch information
Dregu authored Feb 24, 2023
1 parent f8fef0f commit 08628db
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 9 additions & 8 deletions source/playlunky/mod/mod_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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)
{
Expand All @@ -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);

Expand Down

0 comments on commit 08628db

Please sign in to comment.