aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorThierry Crozat2012-06-05 22:34:37 +0100
committerThierry Crozat2012-06-05 22:35:36 +0100
commitac76994781fedecbfa74cd43d0983dcd7b06f12c (patch)
treeb157e2e0b02c2311e618df84e7376bf4b1343fff /engines
parentd2c6525d881f5c391b0c94bcb2c10c328aa5492f (diff)
downloadscummvm-rg350-ac76994781fedecbfa74cd43d0983dcd7b06f12c.tar.gz
scummvm-rg350-ac76994781fedecbfa74cd43d0983dcd7b06f12c.tar.bz2
scummvm-rg350-ac76994781fedecbfa74cd43d0983dcd7b06f12c.zip
SWORD1: Use _missingSubTitleStr when asking for an out of bound textId
It was using textId 0, which is not the subtitle we want anyway. So instead of using the wrong subtitle, it is probably better to not display a subtitle at all. A test case for this is with the demo when using non-english language as several subtitles are missing toward the end.
Diffstat (limited to 'engines')
-rw-r--r--engines/sword1/objectman.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sword1/objectman.cpp b/engines/sword1/objectman.cpp
index ed994a97fa..d0803590a7 100644
--- a/engines/sword1/objectman.cpp
+++ b/engines/sword1/objectman.cpp
@@ -105,7 +105,7 @@ char *ObjectMan::lockText(uint32 textId) {
addr += sizeof(Header);
if ((textId & ITM_ID) >= _resMan->readUint32(addr)) {
warning("ObjectMan::lockText(%d): only %d texts in file", textId & ITM_ID, _resMan->readUint32(addr));
- textId = 0; // get first line instead
+ return _missingSubTitleStr;
}
uint32 offset = _resMan->readUint32(addr + ((textId & ITM_ID) + 1) * 4);
if (offset == 0) {