mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +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:
|
||||
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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue