diff options
-rw-r--r-- | engines/hdb/detection.cpp | 6 | ||||
-rw-r--r-- | engines/hdb/hdb.cpp | 6 | ||||
-rw-r--r-- | engines/hdb/saveload.cpp | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp index 5169450910..a63b85fe89 100644 --- a/engines/hdb/detection.cpp +++ b/engines/hdb/detection.cpp @@ -107,13 +107,17 @@ public: } virtual bool hasFeature(MetaEngineFeature f) const; + virtual int getMaximumSaveSlot() const; virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; }; bool HDBMetaEngine::hasFeature(MetaEngineFeature f) const { - return false; + return + (f == kSupportsLoadingDuringStartup); } +int HDBMetaEngine::getMaximumSaveSlot() const { return 9; } + bool HDBMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { if (desc) { *engine = new HDB::HDBGame(syst, desc); diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp index 1f45a40749..462cb81d6d 100644 --- a/engines/hdb/hdb.cpp +++ b/engines/hdb/hdb.cpp @@ -776,7 +776,11 @@ Common::Error HDBGame::run() { startMap(mapname); } else { - startMap("MAP00"); + if (ConfMan.hasKey("save_slot")) { + loadGameState(ConfMan.getInt("save_slot")); + } else { + startMap("MAP00"); + } } //_window->openDialog("Sgt. Filibuster", 0, "You address me as 'sarge' or 'sergeant' or get your snappin' teeth kicked in! Got me?", 0, NULL); diff --git a/engines/hdb/saveload.cpp b/engines/hdb/saveload.cpp index 5f977fe70f..b8d2252f2b 100644 --- a/engines/hdb/saveload.cpp +++ b/engines/hdb/saveload.cpp @@ -67,6 +67,11 @@ Common::Error HDBGame::loadGameState(int slot) { // Actual Save Data loadGame(in); + _lua->loadLua(_currentLuaName); // load the Lua code FIRST! (if no file, it's ok) + + saveFileName = Common::String::format("%s.l.%03d", _targetName.c_str(), slot); + _lua->loadSaveFile(in, saveFileName.c_str()); + delete in; return Common::kNoError; |