diff options
author | Colin Snover | 2016-09-21 10:45:16 -0500 |
---|---|---|
committer | Colin Snover | 2016-09-29 19:39:16 -0500 |
commit | aa720ca9cd035912a422ece64111d80346b4f477 (patch) | |
tree | b2eddf0f9979b0ca8081288f932142f680dce833 /engines/sci | |
parent | fba85684845f83cab3b51e8fc22b11d59ed9cd28 (diff) | |
download | scummvm-rg350-aa720ca9cd035912a422ece64111d80346b4f477.tar.gz scummvm-rg350-aa720ca9cd035912a422ece64111d80346b4f477.tar.bz2 scummvm-rg350-aa720ca9cd035912a422ece64111d80346b4f477.zip |
SCI32: Fix deleting save games in KQ7
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kfile.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 0980f3cdfe..596ff5e65a 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -378,7 +378,7 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) { byte *out = buffer; for (uint i = 0; i < numSaves; ++i) { - WRITE_UINT16(out, saves[i].id); + WRITE_UINT16(out, saves[i].id - kSaveIdShift); Common::strlcpy((char *)out + sizeof(int16), saves[i].name, SCI_MAX_SAVENAME_LENGTH); out += recordSize; } @@ -542,6 +542,13 @@ reg_t kFileIOUnlink(EngineState *s, int argc, reg_t *argv) { result = saveFileMan->removeSavefile(name); #ifdef ENABLE_SCI32 } else if (getSciVersion() >= SCI_VERSION_2) { + // Special case for KQ7, basically identical to the SQ4 case above, + // where the game hardcodes its save game names + if (name.hasPrefix("kq7cdsg.")) { + int saveNo = atoi(name.c_str() + name.size() - 3); + name = g_sci->getSavegameName(saveNo + kSaveIdShift); + } + // The file name may be already wrapped, so check both cases result = saveFileMan->removeSavefile(name); if (!result) { |