diff options
author | Jaromir Wysoglad | 2019-07-01 09:45:14 +0200 |
---|---|---|
committer | Thierry Crozat | 2019-07-28 15:09:14 +0100 |
commit | 28a70bb615ab7e1afff37ca975ad28f6c2a7bdd0 (patch) | |
tree | b19191ee68a559adbe0c94506928e19ad30598db /engines/supernova | |
parent | 061d14e7996cce22a2012aea8514a58c10c5ee74 (diff) | |
download | scummvm-rg350-28a70bb615ab7e1afff37ca975ad28f6c2a7bdd0.tar.gz scummvm-rg350-28a70bb615ab7e1afff37ca975ad28f6c2a7bdd0.tar.bz2 scummvm-rg350-28a70bb615ab7e1afff37ca975ad28f6c2a7bdd0.zip |
SUPERNOVA: Fix german save and load feature.
Diffstat (limited to 'engines/supernova')
-rw-r--r-- | engines/supernova/detection.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/supernova/detection.cpp b/engines/supernova/detection.cpp index b68c44cdff..f6fe201e82 100644 --- a/engines/supernova/detection.cpp +++ b/engines/supernova/detection.cpp @@ -135,9 +135,9 @@ bool SupernovaMetaEngine::createInstance(OSystem *syst, Engine **engine, const A SaveStateList SupernovaMetaEngine::listSaves(const char *target) const { Common::StringArray filenames; Common::String pattern; - if (!strcmp(target, "msn1")) + if (!strncmp(target, "msn1", 4)) pattern = Common::String::format("msn_save.###"); - if (!strcmp(target, "msn2")) + if (!strncmp(target, "msn2", 4)) pattern = Common::String::format("ms2_save.###"); filenames = g_system->getSavefileManager()->listSavefiles(pattern); @@ -150,8 +150,8 @@ SaveStateList SupernovaMetaEngine::listSaves(const char *target) const { Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(*file); if (savefile) { uint saveHeader = savefile->readUint32LE(); - if ((saveHeader == SAVEGAME_HEADER && !strcmp(target, "msn1")) || - (saveHeader == SAVEGAME_HEADER2 && !strcmp(target, "msn2"))) { + if ((saveHeader == SAVEGAME_HEADER && !strncmp(target, "msn1", 4)) || + (saveHeader == SAVEGAME_HEADER2 && !strncmp(target, "msn2", 4))) { byte saveVersion = savefile->readByte(); if (saveVersion <= SAVEGAME_VERSION) { int saveFileDescSize = savefile->readSint16LE(); @@ -172,25 +172,25 @@ SaveStateList SupernovaMetaEngine::listSaves(const char *target) const { void SupernovaMetaEngine::removeSaveState(const char *target, int slot) const { Common::String filename; - if (!strcmp(target, "msn1")) + if (!strncmp(target, "msn1", 4)) filename = Common::String::format("msn_save.%03d", slot); - if (!strcmp(target, "msn2")) + if (!strncmp(target, "msn2", 4)) filename = Common::String::format("ms2_save.%03d", slot); g_system->getSavefileManager()->removeSavefile(filename); } SaveStateDescriptor SupernovaMetaEngine::querySaveMetaInfos(const char *target, int slot) const { Common::String fileName; - if (!strcmp(target, "msn1")) + if (!strncmp(target, "msn1", 4)) fileName = Common::String::format("msn_save.%03d", slot); - if (!strcmp(target, "msn2")) + if (!strncmp(target, "msn2", 4)) fileName = Common::String::format("ms2_save.%03d", slot); Common::InSaveFile *savefile = g_system->getSavefileManager()->openForLoading(fileName); if (savefile) { uint saveHeader = savefile->readUint32LE(); - if ((!strcmp(target, "msn1") && saveHeader != SAVEGAME_HEADER) || - (!strcmp(target, "msn2") && saveHeader != SAVEGAME_HEADER2)) { + if ((!strncmp(target, "msn1", 4) && saveHeader != SAVEGAME_HEADER) || + (!strncmp(target, "msn2", 4) && saveHeader != SAVEGAME_HEADER2)) { delete savefile; return SaveStateDescriptor(); } |