1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-03 15:09:39 +00:00

Add a dummy GetStat function returning 0 (Fixes #1589)

This commit is contained in:
scrawl 2014-06-30 17:49:01 +02:00
parent 85a1f9d37b
commit 2506c16bf5
4 changed files with 21 additions and 1 deletions

View file

@ -403,5 +403,7 @@ op 0x200024a: OnMurder, explicit
op 0x200024b: ToggleMenus op 0x200024b: ToggleMenus
op 0x200024c: Face op 0x200024c: Face
op 0x200024d: Face, explicit op 0x200024d: Face, explicit
op 0x200024e: GetStat (dummy function)
op 0x200024f: GetStat (dummy function), explicit
opcodes 0x200024e-0x3ffffff unused opcodes 0x2000250-0x3ffffff unused

View file

@ -1165,6 +1165,17 @@ namespace MWScript
} }
}; };
template <class R>
class OpGetStat : public Interpreter::Opcode0
{
public:
virtual void execute (Interpreter::Runtime& runtime)
{
// dummy
runtime.push(0);
}
};
void installOpcodes (Interpreter::Interpreter& interpreter) void installOpcodes (Interpreter::Interpreter& interpreter)
{ {
for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i) for (int i=0; i<Compiler::Stats::numberOfAttributes; ++i)
@ -1307,6 +1318,8 @@ namespace MWScript
interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolfExplicit, new OpSetWerewolf<ExplicitRef, false>); interpreter.installSegment5 (Compiler::Stats::opcodeUndoWerewolfExplicit, new OpSetWerewolf<ExplicitRef, false>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobatics, new OpSetWerewolfAcrobatics<ImplicitRef>); interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobatics, new OpSetWerewolfAcrobatics<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit, new OpSetWerewolfAcrobatics<ExplicitRef>); interpreter.installSegment5 (Compiler::Stats::opcodeSetWerewolfAcrobaticsExplicit, new OpSetWerewolfAcrobatics<ExplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetStat, new OpGetStat<ImplicitRef>);
interpreter.installSegment5 (Compiler::Stats::opcodeGetStatExplicit, new OpGetStat<ExplicitRef>);
} }
} }
} }

View file

@ -431,6 +431,8 @@ namespace Compiler
extensions.registerInstruction("setlevel", "l", opcodeSetLevel, opcodeSetLevelExplicit); extensions.registerInstruction("setlevel", "l", opcodeSetLevel, opcodeSetLevelExplicit);
extensions.registerFunction("getlevel", 'l', "", opcodeGetLevel, opcodeGetLevelExplicit); extensions.registerFunction("getlevel", 'l', "", opcodeGetLevel, opcodeGetLevelExplicit);
extensions.registerFunction("getstat", 'l', "c", opcodeGetStat, opcodeGetStatExplicit);
extensions.registerFunction ("getdeadcount", 'l', "c", opcodeGetDeadCount); extensions.registerFunction ("getdeadcount", 'l', "c", opcodeGetDeadCount);
extensions.registerFunction ("getpcfacrep", 'l', "/c", opcodeGetPCFacRep, opcodeGetPCFacRepExplicit); extensions.registerFunction ("getpcfacrep", 'l', "/c", opcodeGetPCFacRep, opcodeGetPCFacRepExplicit);

View file

@ -410,6 +410,9 @@ namespace Compiler
const int opcodeRemoveEffectsExplicit = 0x200022e; const int opcodeRemoveEffectsExplicit = 0x200022e;
const int opcodeResurrect = 0x200022f; const int opcodeResurrect = 0x200022f;
const int opcodeResurrectExplicit = 0x2000230; const int opcodeResurrectExplicit = 0x2000230;
const int opcodeGetStat = 0x200024e;
const int opcodeGetStatExplicit = 0x200024f;
} }
namespace Transformation namespace Transformation