mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 20:39:40 +00:00
added activate instruction
This commit is contained in:
parent
15124601aa
commit
1902dfb7b2
2 changed files with 20 additions and 1 deletions
|
@ -76,4 +76,5 @@ op 0x2000069-0x200006b: ModDynamic (health, magicka, fatigue)
|
||||||
op 0x200006c-0x200006e: ModDynamic (health, magicka, fatigue), explicit reference
|
op 0x200006c-0x200006e: ModDynamic (health, magicka, fatigue), explicit reference
|
||||||
op 0x200006f-0x2000071: GetDynamic (health, magicka, fatigue)
|
op 0x200006f-0x2000071: GetDynamic (health, magicka, fatigue)
|
||||||
op 0x2000072-0x2000074: GetDynamic (health, magicka, fatigue), explicit reference
|
op 0x2000072-0x2000074: GetDynamic (health, magicka, fatigue), explicit reference
|
||||||
opcodes 0x2000075-0x3ffffff unused
|
op 0x2000075: Activate
|
||||||
|
opcodes 0x2000076-0x3ffffff unused
|
||||||
|
|
|
@ -38,19 +38,37 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OpActivate : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
InterpreterContext& context =
|
||||||
|
static_cast<InterpreterContext&> (runtime.getContext());
|
||||||
|
|
||||||
|
MWWorld::Ptr ptr = context.getReference();
|
||||||
|
|
||||||
|
context.executeActivation();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const int opcodeXBox = 0x200000c;
|
const int opcodeXBox = 0x200000c;
|
||||||
const int opcodeOnActivate = 0x200000d;
|
const int opcodeOnActivate = 0x200000d;
|
||||||
|
const int opcodeActivate = 0x2000075;
|
||||||
|
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
||||||
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate);
|
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate);
|
||||||
|
extensions.registerInstruction ("activate", "", opcodeActivate);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
{
|
{
|
||||||
interpreter.installSegment5 (opcodeXBox, new OpXBox);
|
interpreter.installSegment5 (opcodeXBox, new OpXBox);
|
||||||
interpreter.installSegment5 (opcodeOnActivate, new OpOnActivate);
|
interpreter.installSegment5 (opcodeOnActivate, new OpOnActivate);
|
||||||
|
interpreter.installSegment5 (opcodeActivate, new OpActivate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue