aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
authorJohannes Schickel2008-12-20 23:15:46 +0000
committerJohannes Schickel2008-12-20 23:15:46 +0000
commitf3f93da8b8a2770d830e7b66ae76fdd028adeaed (patch)
tree7169fb82ef0f025ce591ba1b035f3c238bc19afa /engines/tinsel
parentc3041ad99b9e6bf87de7d16defb5b5a255f44745 (diff)
downloadscummvm-rg350-f3f93da8b8a2770d830e7b66ae76fdd028adeaed.tar.gz
scummvm-rg350-f3f93da8b8a2770d830e7b66ae76fdd028adeaed.tar.bz2
scummvm-rg350-f3f93da8b8a2770d830e7b66ae76fdd028adeaed.zip
- Added comment about error check when loading save on startup
- Updated code to properly test the last three digits of save filenames instead of only the last two svn-id: r35455
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/detection.cpp6
-rw-r--r--engines/tinsel/tinsel.cpp3
2 files changed, 6 insertions, 3 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index ec1a6310ef..e5c5678435 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -486,8 +486,8 @@ SaveStateList TinselMetaEngine::listSaves(const char *target) const {
SaveStateList saveList;
int slotNum = 0;
for (Common::StringList::const_iterator file = files.begin(); file != files.end(); ++file) {
- // Obtain the last 2 digits of the filename, since they correspond to the save slot
- slotNum = atoi(file->c_str() + file->size() - 2);
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ slotNum = atoi(file->c_str() + file->size() - 3);
const Common::String &fname = *file;
Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(fname.c_str());
@@ -563,7 +563,7 @@ Common::Error TinselEngine::loadGameState(int slot) {
const int numStates = Tinsel::getList();
for (int i = 0; i < numStates; ++i) {
const char *fileName = Tinsel::ListEntry(i, Tinsel::LE_NAME);
- const int saveSlot = atoi(fileName + strlen(fileName) - 2);
+ const int saveSlot = atoi(fileName + strlen(fileName) - 3);
if (saveSlot == slot) {
listSlot = i;
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index e9bd50e142..ddfde0df6d 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -992,6 +992,9 @@ Common::Error TinselEngine::go() {
//dumpMusic(); // dumps all of the game's music in external XMIDI files
// Load game from specified slot, if any
+ //
+ // TODO: We might want to think about taking care of possible errors
+ // when loading the save state.
if (ConfMan.hasKey("save_slot"))
loadGameState(ConfMan.getInt("save_slot"));