From dbdbb9b5b3bbf39b9075cc39aa38a51a43cdd5ec Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 24 Jul 2017 00:57:13 -0500 Subject: SCI32: Match 4-language MGDX extra save game data --- engines/sci/engine/kfile.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'engines/sci') diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 6c96607664..1a6695f882 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -367,7 +367,16 @@ reg_t kFileIOOpen(EngineState *s, int argc, reg_t *argv) { // Create a virtual file containing the save game description // and avatar ID, as the game scripts expect. int saveNo; - sscanf(name.c_str(), "%d.DTA", &saveNo); + + // The 4-language release uses a slightly different filename + // structure that includes the letter of the language at the start + // of the filename + const int skip = name.firstChar() < '0' || name.firstChar() > '9'; + + if (sscanf(name.c_str() + skip, "%i.DTA", &saveNo) != 1) { + warning("Could not parse game filename %s", name.c_str()); + } + saveNo += kSaveIdShift; SavegameDesc save; -- cgit v1.2.3