aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorD G Turner2013-07-14 05:07:11 +0100
committerD G Turner2013-07-14 05:07:11 +0100
commit485118ecd9640538337672e3a00bb312803da666 (patch)
tree2364647d0cd85498336c7a685c169da90e62d023
parent1946dead77378bbf16cb1ed65c9937226c749a5e (diff)
downloadscummvm-rg350-485118ecd9640538337672e3a00bb312803da666.tar.gz
scummvm-rg350-485118ecd9640538337672e3a00bb312803da666.tar.bz2
scummvm-rg350-485118ecd9640538337672e3a00bb312803da666.zip
TUCKER: Add support for skipping unhandled/invalid instructions.
This ensures that if any unhandled/invalid instructions are present, they are skipped, rather than locking up engine execution. This is a secondary fix for bug #3614697 - "Spanish version uncompletable at end of 2nd part" and any other future bugs of this type.
-rw-r--r--engines/tucker/tucker.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index e3fd928e6c..122be958ff 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -3064,8 +3064,9 @@ static const struct {
int TuckerEngine::readTableInstructionCode(int *index) {
bool match = false;
+ int nameLen = 0;
for (int i = 0; _instructions[i].name; ++i) {
- const int nameLen = strlen(_instructions[i].name);
+ nameLen = strlen(_instructions[i].name);
if (_instructions[i].name[1] == '0') {
if (_instructions[i].name[0] == _tableInstructionsPtr[0] && _instructions[i].name[2] == _tableInstructionsPtr[2]) {
const char digit = _tableInstructionsPtr[1];
@@ -3085,6 +3086,7 @@ int TuckerEngine::readTableInstructionCode(int *index) {
}
}
warning("Unhandled instruction '%c%c%c'", _tableInstructionsPtr[0], _tableInstructionsPtr[1], _tableInstructionsPtr[2]);
+ _tableInstructionsPtr += nameLen + 1;
return kCode_invalid;
}