aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword1/control.h2
-rw-r--r--engines/sword1/sword1.cpp14
2 files changed, 10 insertions, 6 deletions
diff --git a/engines/sword1/control.h b/engines/sword1/control.h
index b1f81165be..912ccf8f72 100644
--- a/engines/sword1/control.h
+++ b/engines/sword1/control.h
@@ -83,11 +83,11 @@ public:
void doRestore(void);
void askForCd(void);
bool savegamesExist(void);
+ bool restoreGameFromFile(uint8 slot);
private:
int displayMessage(const char *altButton, const char *message, ...);
void saveGameToFile(uint8 slot);
- bool restoreGameFromFile(uint8 slot);
void readSavegameDescriptions(void);
void writeSavegameDescriptions(void);
void showSavegameNames(void);
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index b88713eda1..0d610d5251 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -445,19 +445,23 @@ void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or
}
int SwordEngine::go() {
-
uint16 startPos = ConfMan.getInt("boot_param");
- if (startPos)
+ if (startPos) {
_logic->startPositions(startPos);
- else {
- if (_control->savegamesExist()) {
+ } else {
+ int saveSlot = ConfMan.getInt("save_slot");
+ if (_control->restoreGameFromFile(saveSlot - 1)) {
+ _control->doRestore();
+ } else if (_control->savegamesExist()) {
_systemVars.controlPanelMode = CP_NEWGAME;
if (_control->runPanel() == CONTROL_GAME_RESTORED)
_control->doRestore();
else if (!_systemVars.engineQuit)
_logic->startPositions(0);
- } else // no savegames, start new game.
+ } else {
+ // no savegames, start new game.
_logic->startPositions(0);
+ }
}
_systemVars.controlPanelMode = CP_NORMAL;