aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel/detection.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2011-08-22 20:03:05 +0200
committerAlyssa Milburn2011-08-22 20:03:05 +0200
commit84063dc9727a9f55e09d39574027beab695680e6 (patch)
treed71a9599cb550d9f7949a2d3209574064e054d85 /engines/tinsel/detection.cpp
parentc6e89df3d940747a85d447f172e2323c800f5eaf (diff)
parenta39a3eda46aea108a51556f001617ad28d29e520 (diff)
downloadscummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.gz
scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.bz2
scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.zip
Merge remote-tracking branch 'origin/master' into soltys_wip2
Diffstat (limited to 'engines/tinsel/detection.cpp')
-rw-r--r--engines/tinsel/detection.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index 9c52305a1c..1fce032633 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -322,9 +322,21 @@ int TinselMetaEngine::getMaximumSaveSlot() const { return 99; }
void TinselMetaEngine::removeSaveState(const char *target, int slot) const {
Tinsel::setNeedLoad();
- Tinsel::getList(g_system->getSavefileManager(), target);
+ // Same issue here as with loadGameState(): we need the physical savegame
+ // slot. Refer to bug #3387551.
+ int listSlot = -1;
+ const int numStates = Tinsel::getList(g_system->getSavefileManager(), target);
+ for (int i = 0; i < numStates; ++i) {
+ const char *fileName = Tinsel::ListEntry(i, Tinsel::LE_NAME);
+ const int saveSlot = atoi(fileName + strlen(fileName) - 3);
+
+ if (saveSlot == slot) {
+ listSlot = i;
+ break;
+ }
+ }
- g_system->getSavefileManager()->removeSavefile(Tinsel::ListEntry(slot, Tinsel::LE_NAME));
+ g_system->getSavefileManager()->removeSavefile(Tinsel::ListEntry(listSlot, Tinsel::LE_NAME));
Tinsel::setNeedLoad();
Tinsel::getList(g_system->getSavefileManager(), target);
}