Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Game Versions: v1.0.x,v1.1.x,v1.2.x,v1.3.x,v1.4.x,v1.5.x
* Fallback path no longer discards the user's load order on validation failure
* Fixed Moduel directory opening
* LauncherEx was switched from OpenGL to DirectX (Why TW?)
* Fixed infinite loading screen when the Continue button loaded a save with changed modules (#144)
---------------------------------------------------------------------------------------------------
Version: 1.6.7
Game Versions: v1.0.x,v1.1.x,v1.2.x,v1.3.x,v1.4.x
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ static void FailedToLoad(string message)
return true;
}

// Skipping the original method also skips its `_latestSaveLoaded = true` re-entry guard.
// OnInitialState is invoked again whenever the initial module screen reactivates, so without
// the guard a /continuegame launch would load the latest save on top of the running game
if (AccessTools2.FieldRefAccess<bool>(sandBoxSubModuleType, "_latestSaveLoaded") is { } latestSaveLoaded)
latestSaveLoaded(__instance) = true;

using (var _ = new InformationManagerConfirmInquiryHandler())
tryLoadSave(saveFile, startGame);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ static void FailedToLoad(string message)
return true;
}

// Skipping the original method also skips its `_latestSaveLoaded = true` re-entry guard.
// OnInitialState is invoked again whenever the initial module screen reactivates, so without
// the guard a /continuegame launch would load the latest save on top of the running game
if (AccessTools2.FieldRefAccess<bool>(sandBoxSubModuleType, "_latestSaveLoaded") is { } latestSaveLoaded)
latestSaveLoaded(__instance) = true;

using (var _ = new InformationManagerConfirmInquiryHandler())
tryLoadSave(saveFile, startGame);

Expand Down
4 changes: 4 additions & 0 deletions src/Bannerlord.LauncherEx/Mixins/LauncherVMMixin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@ public void ExecuteStartGameOverride(int mode)
return;
}

// A save file picked in the Saves tab earlier (e.g. a warned load that was cancelled) leaves
// /continuesave set; combined with /continuegame it makes the game load two saves at once
AsyncContext.Run(() => _launcherManagerHandler.SetGameParameterSaveFileAsync(null));

if (mode == 1)
{
AsyncContext.Run(() => _launcherManagerHandler.SetGameParameterContinueLastSaveFileAsync(true));
Expand Down
Loading