diff options
Diffstat (limited to 'engines/tinsel/detection.cpp')
-rw-r--r-- | engines/tinsel/detection.cpp | 16 |
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); } |