mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-17 21:00:21 +02:00
avoid incrementing m_CodePos in OP_STORE_STRING and OP_STORE_VECTOR as fetchOpcodeValue() already does that
This commit is contained in:
1 parent
1776ac2344
commit
fd871d6c8f
1 file changed
+2
-7
@@ -1727,21 +1727,15 @@ void ScriptVM::Execute(ScriptVariable* data, int dataSize, str label)
|
||||
case OP_STORE_STRING:
|
||||
m_VMStack.Push();
|
||||
m_VMStack.GetTop().setConstStringValue(fetchOpcodeValue<unsigned int>());
|
||||
|
||||
m_CodePos += sizeof(unsigned int);
|
||||
|
||||
break;
|
||||
|
||||
case OP_STORE_VECTOR:
|
||||
m_VMStack.Push();
|
||||
m_VMStack.GetTop().setVectorValue(fetchOpcodeValue<Vector>());
|
||||
|
||||
m_CodePos += sizeof(Vector);
|
||||
|
||||
break;
|
||||
|
||||
case OP_SWITCH:
|
||||
if (!Switch(fetchOpcodeValue<StateScript*>(), m_VMStack.Pop()))
|
||||
if (!Switch(fetchActualOpcodeValue<StateScript*>(), m_VMStack.Pop()))
|
||||
{
|
||||
m_CodePos += sizeof(StateScript*);
|
||||
}
|
||||
@@ -1824,6 +1818,7 @@ void ScriptVM::Execute(ScriptVariable* data, int dataSize, str label)
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"Invalid opcode");
|
||||
if (*opcode < OP_MAX)
|
||||
{
|
||||
glbs.DPrintf("unknown opcode %d ('%s')\n", *opcode, OpcodeName(*opcode));
|
||||
|
||||
Reference in new issue
Block a user