diff options
author | Paul Gilbert | 2015-10-04 20:56:13 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-10-04 20:56:13 -0400 |
commit | e73a50c6c53bffcf10f044377a72cf754b524bf9 (patch) | |
tree | 6964c79b740c55861de1e1312ca65e14bca25f61 /engines/sherlock | |
parent | f6b647c420e1525f3127820fb404b2bc1df9c66e (diff) | |
download | scummvm-rg350-e73a50c6c53bffcf10f044377a72cf754b524bf9.tar.gz scummvm-rg350-e73a50c6c53bffcf10f044377a72cf754b524bf9.tar.bz2 scummvm-rg350-e73a50c6c53bffcf10f044377a72cf754b524bf9.zip |
SHERLOCK: SS: Fix invalid characters when displaying journal
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/fonts.cpp | 11 | ||||
-rw-r--r-- | engines/sherlock/talk.cpp | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/engines/sherlock/fonts.cpp b/engines/sherlock/fonts.cpp index 482e795b6d..b607891d06 100644 --- a/engines/sherlock/fonts.cpp +++ b/engines/sherlock/fonts.cpp @@ -147,10 +147,13 @@ void Fonts::writeString(Surface *surface, const Common::String &str, } curChar = translateChar(curChar); - assert(curChar < _charCount); - ImageFrame &frame = (*_font)[curChar]; - surface->transBlitFrom(frame, Common::Point(charPos.x, charPos.y + _yOffsets[curChar]), false, overrideColor); - charPos.x += frame._frame.w + 1; + if (curChar < _charCount) { + ImageFrame &frame = (*_font)[curChar]; + surface->transBlitFrom(frame, Common::Point(charPos.x, charPos.y + _yOffsets[curChar]), false, overrideColor); + charPos.x += frame._frame.w + 1; + } else { + warning("Invalid character encountered - %d", (int)curChar); + } } } diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index e399c268ed..4150835fb8 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -915,6 +915,8 @@ bool Talk::isOpcode(byte checkCharacter) { } bool Talk::isPossibleOpcode(byte checkCharacter) { + // Some conversations in the Spanish version, such as the first conversation with Lastrade, + // start with an invalid character. Hence isPossibleOpcode being separate from isOpcode if (IS_SERRATED_SCALPEL && _vm->getLanguage() == Common::ES_ESP) return checkCharacter >= 128; |