aboutsummaryrefslogtreecommitdiff
path: root/engines/saga/saga.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2007-09-30 01:29:12 +0000
committerFilippos Karapetis2007-09-30 01:29:12 +0000
commit939948766b1afbd6437eb5d77563eb3362f62c3c (patch)
tree471f4f7634c22ae172db61de8909c7d51bb46a0f /engines/saga/saga.cpp
parent7ca277d2525da7a28b8fe6949970ccbbfd28b1f4 (diff)
downloadscummvm-rg350-939948766b1afbd6437eb5d77563eb3362f62c3c.tar.gz
scummvm-rg350-939948766b1afbd6437eb5d77563eb3362f62c3c.tar.bz2
scummvm-rg350-939948766b1afbd6437eb5d77563eb3362f62c3c.zip
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
Diffstat (limited to 'engines/saga/saga.cpp')
-rw-r--r--engines/saga/saga.cpp15
1 files changed, 13 insertions, 2 deletions
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)