From eb5f4548819052bc6d33fce2e291b3ca864fbf06 Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Sun, 10 Feb 2019 18:08:54 +0100 Subject: BLADERUNNER: Added auto save feature Also fixed a bug in KIA save screen, where not selecting a save slot can lead to overwriting other save game. --- engines/bladerunner/ui/kia_section_save.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/bladerunner/ui') diff --git a/engines/bladerunner/ui/kia_section_save.cpp b/engines/bladerunner/ui/kia_section_save.cpp index b042dc8097..6bdcec964e 100644 --- a/engines/bladerunner/ui/kia_section_save.cpp +++ b/engines/bladerunner/ui/kia_section_save.cpp @@ -366,7 +366,9 @@ void KIASectionSave::save() { slot = _saveList[_selectedLineId].getSaveSlot(); } else { // Find first available save slot + int maxSlot = -1; for (int i = 0; i < (int)_saveList.size(); ++i) { + maxSlot = MAX(maxSlot, _saveList[i].getSaveSlot()); if (_saveList[i].getSaveSlot() != i) { slot = i; break; @@ -374,7 +376,7 @@ void KIASectionSave::save() { } if (slot == -1) { - slot = _saveList.size(); + slot = maxSlot + 1; } } -- cgit v1.2.3