diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp index 861d8f89a0b..5ed163f364e 100644 --- a/engines/titanic/true_talk/tt_vocab.cpp +++ b/engines/titanic/true_talk/tt_vocab.cpp @@ -182,10 +182,10 @@ TTword *TTvocab::getWord(TTstring &str, TTword **srcWord) const { if (!word) { TTstring tempStr(str); if (tempStr.size() > 2) { - word = getSuffixedWord(tempStr); + word = getSuffixedWord(tempStr, srcWord); if (!word) - word = getPrefixedWord(tempStr); + word = getPrefixedWord(tempStr, srcWord); } } @@ -230,11 +230,11 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const { return newWord; } -TTword *TTvocab::getSuffixedWord(TTstring &str) const { +TTword *TTvocab::getSuffixedWord(TTstring &str, TTword **srcWord) const { TTstring tempStr(str); TTword *word = nullptr; - if (g_vm->isGerman()) { + if (g_language == Common::DE_DEU) { static const char *const SUFFIXES[11] = { "est", "em", "en", "er", "es", "et", "st", "s", "e", "n", "t" @@ -243,7 +243,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const { for (int idx = 0; idx < 11; ++idx) { if (tempStr.hasSuffix(SUFFIXES[idx])) { tempStr.deleteSuffix(strlen(SUFFIXES[idx])); - word = getPrimeWord(tempStr); + word = getPrimeWord(tempStr, srcWord); if (word) break; tempStr = str; @@ -514,7 +514,7 @@ TTword *TTvocab::getSuffixedWord(TTstring &str) const { return word; } -TTword *TTvocab::getPrefixedWord(TTstring &str) const { +TTword *TTvocab::getPrefixedWord(TTstring &str, TTword **srcWord) const { TTstring tempStr(str); TTword *word = nullptr; int prefixLen = 0; diff --git a/engines/titanic/true_talk/tt_vocab.h b/engines/titanic/true_talk/tt_vocab.h index 7e5cc29bc53..def42ba63d7 100644 --- a/engines/titanic/true_talk/tt_vocab.h +++ b/engines/titanic/true_talk/tt_vocab.h @@ -68,7 +68,7 @@ private: * @param str Word to check * @returns New word instance for found match, or nullptr otherwise */ - TTword *getSuffixedWord(TTstring &str) const; + TTword *getSuffixedWord(TTstring &str, TTword **srcWord = nullptr) const; /** * Checks the passed word for common prefixes, and checks for a word @@ -76,7 +76,7 @@ private: * @param str Word to check * @returns New word instance for found match, or nullptr otherwise */ - TTword *getPrefixedWord(TTstring &str) const; + TTword *getPrefixedWord(TTstring &str, TTword **srcWord = nullptr) const; public: TTvocab(VocabMode vocabMode); ~TTvocab();