aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorColin Snover2017-09-28 14:48:13 -0500
committerColin Snover2017-09-28 14:58:18 -0500
commit7de9c1682b9d9967bcea6294733c5e7f2fd000ee (patch)
treebf26bd93989d095eab3715ee13706b4612281964 /engines/sci/engine
parentc81348e3fe6b49cf8671e476d74469846542f950 (diff)
downloadscummvm-rg350-7de9c1682b9d9967bcea6294733c5e7f2fd000ee.tar.gz
scummvm-rg350-7de9c1682b9d9967bcea6294733c5e7f2fd000ee.tar.bz2
scummvm-rg350-7de9c1682b9d9967bcea6294733c5e7f2fd000ee.zip
SCI32: Allow save games to be deleted from original save/restore in RAMA
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/kfile.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index f32888b80c..baa088de1f 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -666,11 +666,15 @@ 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);
+ // Special cases for KQ7 & RAMA, basically identical to the SQ4 case
+ // above, where the game hardcodes its save game names
+ int saveNo;
+ if (sscanf(name.c_str(), "kq7cdsg.%i", &saveNo) == 1 ||
+ sscanf(name.c_str(), "ramasg.%i", &saveNo) == 1) {
+
name = g_sci->getSavegameName(saveNo + kSaveIdShift);
+ } else if (g_sci->getGameId() == GID_RAMA && name == "911.sg") {
+ name = g_sci->getSavegameName(kAutoSaveId);
}
// The file name may be already wrapped, so check both cases