DRASCULA: Fix loading game from launcher

This was particularly an issue when the game had been saved in
chapter 1 as in this case the load would happen too early and
the game would crash. In other cases it was working but was
not optimal (the gane loop was run once before it succeeded
to load the game).

This fixes bug #10959.
This commit is contained in:
Thierry Crozat 2019-05-13 22:52:41 +01:00
parent d0f210aeec
commit 9230026876

View File

@ -274,7 +274,11 @@ Common::Error DrasculaEngine::run() {
// Check if a save is loaded from the launcher
int directSaveSlotLoading = ConfMan.getInt("save_slot");
if (directSaveSlotLoading >= 0) {
// Set the current chapter to -1. This forces the load to happen
// later during the game loop, and not now.
currentChapter = -1;
loadGame(directSaveSlotLoading);
currentChapter++;
}
checkCD();