From ac76994781fedecbfa74cd43d0983dcd7b06f12c Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Tue, 5 Jun 2012 22:34:37 +0100 Subject: 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. --- engines/sword1/objectman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3