[Scummvm-git-logs] scummvm master -> 2e5d5ba9ac63bfdb9404883b2fd70f98a85cb1f1

dreammaster paulfgilbert at gmail.com
Tue Nov 3 03:54:48 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2e5d5ba9ac GLK: COMPREHEND: Workaround for crash trying to get non-items


Commit: 2e5d5ba9ac63bfdb9404883b2fd70f98a85cb1f1
    https://github.com/scummvm/scummvm/commit/2e5d5ba9ac63bfdb9404883b2fd70f98a85cb1f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-11-02T19:54:37-08:00

Commit Message:
GLK: COMPREHEND: Workaround for crash trying to get non-items

In the original interpreter, if the first test following an OR
opcode fails, it doesn't execute the second, whereas ScummVM
does. This causes a crash in function 19h, where an OR
first tests if the noun is an item, and then if the item is
takeable. Rather than risking fiddling around with how the OR
functions, for now I've simply added an extra check to
OPCODE_OBJECT_TAKEABLE to allow for it

Changed paths:
    engines/glk/comprehend/game_opcodes.cpp


diff --git a/engines/glk/comprehend/game_opcodes.cpp b/engines/glk/comprehend/game_opcodes.cpp
index 09336b9f92..e049f1fb64 100644
--- a/engines/glk/comprehend/game_opcodes.cpp
+++ b/engines/glk/comprehend/game_opcodes.cpp
@@ -790,8 +790,9 @@ void ComprehendGameV2::execute_opcode(const Instruction *instr, const Sentence *
 		break;
 
 	case OPCODE_OBJECT_TAKEABLE:
-		item = getItem(instr);
-		func_set_test_result(func_state, (item->_flags & ITEMF_WEIGHT_MASK) != ITEMF_WEIGHT_MASK);
+		// WORKAROUND: Trying to get non-items in OO-Topos
+		func_set_test_result(func_state, instr->_operand[0]
+			&& (getItem(instr)->_flags & ITEMF_WEIGHT_MASK) != ITEMF_WEIGHT_MASK);
 		break;
 
 	case OPCODE_OBJECT_CAN_TAKE:




More information about the Scummvm-git-logs mailing list