[Scummvm-cvs-logs] SF.net SVN: scummvm:[50229] scummvm/trunk/engines/sci/engine/vm.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu Jun 24 22:01:32 CEST 2010
Revision: 50229
http://scummvm.svn.sourceforge.net/scummvm/?rev=50229&view=rev
Author: m_kiewitz
Date: 2010-06-24 20:01:31 +0000 (Thu, 24 Jun 2010)
Log Message:
-----------
SCI: partly reverting r50208, iceman has script code (fred::canBeHere) that asks for property 380. sierra also returned a zero when going out of bounds (see gregs engine object.cpp, ::getPropertyN - fixes iceman, lsl3 and probably more
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-06-24 19:05:59 UTC (rev 50228)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-06-24 20:01:31 UTC (rev 50229)
@@ -112,6 +112,7 @@
//return dummyReg;
}
+<<<<<<< HEAD
// This occurs in LSL3, binoculars scene. This gets called from kDoBresen, so fix
// the relevant invalid selector index. TODO: Why does this occur? This looks like
// a script bug.
@@ -124,6 +125,14 @@
index, obj->getVarCount(), PRINT_REG(obj->getPos()),
s->_segMan->getObjectName(obj->getPos()));
//return dummyReg;
+=======
+ if (index < 0 || (uint)index >= obj->getVarCount()) {
+ // This is same way sierra does it and there are some games, that contain such scripts like
+ // iceman script 998 (fred::canBeHere, executed right at the start)
+ debugC(2, kDebugLevelVM, "[VM] Invalid property #%d (out of [0..%d]) requested!",
+ index, obj->getVarCount());
+ return dummyReg;
+>>>>>>> 208309a... SCI: partly reverting r50208, iceman has script code (fred::canBeHere) that asks for property 380. sierra also returned a zero when going out of bounds (see gregs engine object.cpp, ::getPropertyN - fixes iceman, lsl3 and probably more
}
return obj->getVariableRef(index);
@@ -929,6 +938,8 @@
s->xs->addr.pc.offset += readPMachineInstruction(code_buf + s->xs->addr.pc.offset, extOpcode, opparams);
const byte opcode = extOpcode >> 1;
+ warning("%lx", opcode);
+
switch (opcode) {
case op_bnot: // 0x00 (00)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list