mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
GLK: ADVSYS: Fix actions using OP_SEND
This commit is contained in:
parent
c7a9306415
commit
0bf2dc6d7b
@ -83,6 +83,7 @@ void AdvSys::deinitialize() {
|
||||
}
|
||||
|
||||
bool AdvSys::singleAction() {
|
||||
debug("------------------");
|
||||
// Do the before code
|
||||
switch (execute(_beforeOffset)) {
|
||||
case ABORT:
|
||||
|
@ -93,6 +93,7 @@ ExecutionResult VM::execute(int offset) {
|
||||
_pc = offset;
|
||||
|
||||
// Clear the stack
|
||||
_fp.clear();
|
||||
_stack.clear();
|
||||
|
||||
// Iterate through the script
|
||||
@ -398,9 +399,9 @@ void VM::opSEND() {
|
||||
if (val)
|
||||
val = getObjectField(val, O_CLASS);
|
||||
else
|
||||
val = _fp[_fp[FP_ARGS_SIZE] + FP_ARGS];
|
||||
val = _fp[_fp[FP_ARGS_SIZE] + FP_ARGS - 1];
|
||||
|
||||
if (val && (val = getObjectProperty(val, _fp[_fp[FP_ARGS_SIZE] + 1])) != 0) {
|
||||
if (val && (val = getObjectProperty(val, _fp[_fp[FP_ARGS_SIZE] + FP_ARGS - 2])) != 0) {
|
||||
_pc = getActionField(val, A_CODE);
|
||||
} else {
|
||||
// Return NIL if there's no action for the given message
|
||||
|
@ -180,6 +180,11 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the function pointer
|
||||
*/
|
||||
void clear() { _index = 0; }
|
||||
|
||||
/**
|
||||
* Returns the index in the stack of the function pointer
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user