diff options
Diffstat (limited to 'engines/sword1/objectman.cpp')
-rw-r--r-- | engines/sword1/objectman.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp index 0fff84b6cd..31b13d0e14 100644 --- a/engines/sword1/objectman.cpp +++ b/engines/sword1/objectman.cpp @@ -108,8 +108,13 @@ char *ObjectMan::lockText(uint32 textId) { } uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1)* 4); if (offset == 0) { + // Workaround bug for missing sentence in some langages in Syria (see bug #1977094). + // We use the hardcoded text in this case. + if (textId == 2950145) + return const_cast<char*>(_translationId2950145[lang]); + warning("ObjectMan::lockText(%d): text number has no text lines", textId); - return _errorStr; + return _missingSubTitleStr; } return addr + offset; } @@ -161,6 +166,26 @@ void ObjectMan::saveLiveList(uint16 *dest) { memcpy(dest, _liveList, TOTAL_SECTIONS * sizeof(uint16)); } -char ObjectMan::_errorStr[] = "Error: Text not found."; +// String displayed when a subtitle sentence is missing in the cluster file. +// It happens with at least one sentence in Syria in some langages (see bug +// #1977094). +// Note: an empty string or a null pointer causes a crash. + +char ObjectMan::_missingSubTitleStr[] = " "; + +// Missing translation for textId 2950145 (see bug #1977094). +// Currently text is missing for Portuguese languages. (It's possible that it +// is not needed. The English version of the game does not include Portuguese +// so I cannot check.) + +const char *ObjectMan::_translationId2950145[7] = { + "Oh?", // English (not needed) + "Quoi?", // French + "Oh?", // German + "Eh?", // Italian + "\277Eh?", // Spanish + "Ano?", // Czech + " " // Portuguese +}; } // End of namespace Sword1 |