aboutsummaryrefslogtreecommitdiff
path: root/simon/simon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'simon/simon.cpp')
-rw-r--r--simon/simon.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index d0ff610b00..7e10130e24 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -2513,6 +2513,21 @@ void SimonEngine::o_load_game() {
save_or_load_dialog(true);
}
+int SimonEngine::count_savegames() {
+ File f;
+ uint i = 1;
+
+ while (i < 256) {
+ f.open(gen_savename(i), getSavePath());
+ if (f.isOpen() == false)
+ break;
+
+ f.close();
+ i++;
+ }
+ return i;
+}
+
int SimonEngine::display_savegame_list(int curpos, bool load, char *dst) {
int slot, last_slot;
File in;
@@ -2601,7 +2616,7 @@ void SimonEngine::save_or_load_dialog(bool load) {
_copy_partial_mode = 1;
- num = _number_of_savegames;
+ _number_of_savegames = num = count_savegames();
if (!load)
num++;
num -= 6;