From 1fbd80b1e3eb442df2203d27269623c964a22bad Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Mon, 29 Nov 2010 23:57:15 +0000 Subject: HUGO: Fix save/load screens, which were always showing slot0 info svn-id: r54658 --- engines/hugo/detection.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines') diff --git a/engines/hugo/detection.cpp b/engines/hugo/detection.cpp index 05fe984615..d567275981 100644 --- a/engines/hugo/detection.cpp +++ b/engines/hugo/detection.cpp @@ -209,11 +209,14 @@ SaveStateList HugoMetaEngine::listSaves(const char *target) const { sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) SaveStateList saveList; + char slot[3]; int slotNum = 0; for (Common::StringArray::const_iterator filename = filenames.begin(); filename != filenames.end(); ++filename) { - // Obtain the last 3 digits of the filename, since they correspond to the save slot - slotNum = atoi(filename->c_str() + filename->size() - 3); - + slot[0] = filename->c_str()[filename->size() - 6]; + slot[1] = filename->c_str()[filename->size() - 5]; + slot[2] = '\0'; + // Obtain the last 2 digits of the filename (without extension), since they correspond to the save slot + slotNum = atoi(slot); if (slotNum >= 0 && slotNum <= getMaximumSaveSlot()) { Common::InSaveFile *file = saveFileMan->openForLoading(*filename); if (file) { -- cgit v1.2.3