From e23f91472e6694087e3aee13139b84d227f7f7f1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 14 Oct 2012 13:00:21 +1100 Subject: [PATCH] HOPKINS: Bugfix for loading game text indexes --- engines/hopkins/font.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp index 6f0f22bcd46..5f930063fee 100644 --- a/engines/hopkins/font.cpp +++ b/engines/hopkins/font.cpp @@ -219,11 +219,12 @@ void FontManager::BOITE(int idx, int fileIndex, const Common::String &filename, _vm->_fileManager.CONSTRUIT_FICHIER(_vm->_globals.HOPLINK, filename); file = _vm->_globals.NFICHIER; - if (strncmp(file.c_str(), oldname.c_str(), strlen(file.c_str()))) { + if (strncmp(file.c_str(), oldname.c_str(), strlen(file.c_str())) != 0) { + // Starting to access a new file, so read in the index file for the file oldname = file; - nom_index = file; + nom_index = Common::String(file.c_str(), file.size() - 3); + nom_index += "IND"; - //*(int *)((char *)&dword_80AE4DC + strlen(nom_index) + 1) = dword_807C98D; if (!f.open(nom_index)) error("Error opening file - %s", nom_index.c_str()); filesize = f.size();