From 939948766b1afbd6437eb5d77563eb3362f62c3c Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sun, 30 Sep 2007 01:29:12 +0000 Subject: Fixed bug #1804805 - "IHNM: crash/glitch with italian fan patch" Added the Italian fan translation of IHNM, created a workaround for invalid string data in the Italian fan translation and added some hard coded strings which are changed in the original game executable with the Italian fan translation patch svn-id: r29134 --- engines/saga/saga.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'engines/saga/saga.cpp') diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp index 9601eee44c..df13f36f0a 100644 --- a/engines/saga/saga.cpp +++ b/engines/saga/saga.cpp @@ -343,7 +343,12 @@ void SagaEngine::loadStrings(StringsTable &stringsTable, const byte *stringsPoin break; } if (offset > stringsLength) { - error("SagaEngine::loadStrings wrong strings table"); + // This case should never occur, but apparently it does in the Italian fan + // translation of IHNM + warning("SagaEngine::loadStrings wrong strings table"); + stringsCount = i; + stringsTable.strings = (const char **)realloc(stringsTable.strings, stringsCount * sizeof(*stringsTable.strings)); + break; } stringsTable.strings[i] = (const char *)stringsTable.stringsPointer + offset; debug(9, "string[%i]=%s", i, stringsTable.strings[i]); @@ -384,7 +389,13 @@ const char *SagaEngine::getObjectName(uint16 objectId) { const char *SagaEngine::getTextString(int textStringId) { const char *string; - int lang = (getLanguage() == Common::DE_DEU) ? 1 : 0; + int lang = 0; + + if (getLanguage() == Common::DE_DEU) + lang = 1; + + if (getLanguage() == Common::IT_ITA) + lang = 2; string = ITEinterfaceTextStrings[lang][textStringId]; if (!string) -- cgit v1.2.3