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