aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-08-05 23:08:05 +0000
committerFilippos Karapetis2010-08-05 23:08:05 +0000
commit6c8bcd2ba1cad1312f0a588ca284110bbbb81ccc (patch)
treef0475321dfd5e711d0c32b5781d16fb37a819328
parentb7aa748dd203cf066bab384cca49dc49056b07d5 (diff)
downloadscummvm-rg350-6c8bcd2ba1cad1312f0a588ca284110bbbb81ccc.tar.gz
scummvm-rg350-6c8bcd2ba1cad1312f0a588ca284110bbbb81ccc.tar.bz2
scummvm-rg350-6c8bcd2ba1cad1312f0a588ca284110bbbb81ccc.zip
SCI: Added a workaround for a script bug in QFG2, room 200, when talking with the astrologer. Fixes bug #3039879, "QFG2: Crash at astrologer's"
svn-id: r51772
-rw-r--r--engines/sci/engine/vm.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 35fc3ca566..7bcc5b43a3 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -135,9 +135,13 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
static int validate_arithmetic(reg_t reg) {
if (reg.segment) {
// The results of this are likely unpredictable... It most likely means that a kernel function is returning something wrong.
- // If such an error occurs, we usually need to find the last kernel function called and check its return value. Check
- // callKernelFunc() below
- error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]. Address: %04x:%04x", reg.segment, PRINT_REG(reg));
+ // If such an error occurs, we usually need to find the last kernel function called and check its return value.
+ if (g_sci->getGameId() == GID_QFG2 && g_sci->getEngineState()->currentRoomNumber() == 200) {
+ // WORKAROUND: This happens in QFG2, room 200, when talking to the astrologer (bug #3039879) - script bug.
+ // Returning 0 in this case.
+ } else {
+ error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]. Address: %04x:%04x", reg.segment, PRINT_REG(reg));
+ }
return 0;
}