aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2015-06-12 21:21:55 -0400
committerPaul Gilbert2015-06-12 21:21:55 -0400
commita3fb5ab1fbb0cf3ff448ba9e9966ef21c7dc3847 (patch)
treeeb6059d4c3916a29affe70e52cf7653c5a3053d6 /engines
parenta17823877de5f13810b69757ef14c0b54e3de914 (diff)
downloadscummvm-rg350-a3fb5ab1fbb0cf3ff448ba9e9966ef21c7dc3847.tar.gz
scummvm-rg350-a3fb5ab1fbb0cf3ff448ba9e9966ef21c7dc3847.tar.bz2
scummvm-rg350-a3fb5ab1fbb0cf3ff448ba9e9966ef21c7dc3847.zip
SHERLOCK: RT: Fix cmdSetNPCDescOnOff method
Diffstat (limited to 'engines')
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 0d2e1a99cc..f01cdb0979 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -389,15 +389,19 @@ OpcodeReturn TattooTalk::cmdSetNPCDescOnOff(const byte *&str) {
// Copy over the NPC examine text until we reach a stop marker, which is
// the same as a start marker, or we reach the end of the file
- while (*str && *str != 208)
+ while (*str && *str != _opcodes[OP_NPC_DESC_ON_OFF])
person._examine += *str++;
// Move past any leftover text till we reach a stop marker
- while (*str && *str != 208)
+ while (*str && *str != _opcodes[OP_NPC_DESC_ON_OFF])
str++;
if (!*str)
- str--;
+ // Reached end of file, so decrement pointer so outer loop will terminate on NULL
+ --str;
+ else
+ // Move past the ending OP_NPC_DEST_ON_OFF opcode
+ ++str;
return RET_SUCCESS;
}