From 3442ef17a8ee4dc37d74f63dcd0c95843179ab2b Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 13 Apr 2012 14:54:13 +0200 Subject: [PATCH] fixed ModDisposition --- apps/openmw/mwscript/docs/vmformat.txt | 3 ++- apps/openmw/mwscript/statsextensions.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwscript/docs/vmformat.txt b/apps/openmw/mwscript/docs/vmformat.txt index 17f11d3a9..fda8d1954 100644 --- a/apps/openmw/mwscript/docs/vmformat.txt +++ b/apps/openmw/mwscript/docs/vmformat.txt @@ -139,4 +139,5 @@ op 0x200014a: RemoveSpell, explicit reference op 0x200014b: GetSpell op 0x200014c: GetSpell, explicit reference op 0x200014d: ModDisposition -opcodes 0x200014e-0x3ffffff unused +op 0x200014e: ModDisposition, explicit reference +opcodes 0x200014f-0x3ffffff unused diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index f7a4e5d86..9d3009870 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -435,13 +435,19 @@ namespace MWScript } }; + template class OpModDisposition : public Interpreter::Opcode0 { public: virtual void execute (Interpreter::Runtime& runtime) { + MWWorld::Ptr ptr = R()(runtime); + +// Interpreter::Type_Integer value = runtime[0].mInteger; + runtime.pop(); + /// \todo modify disposition towards the player } }; @@ -487,6 +493,7 @@ namespace MWScript const int opcodePCLowerRank = 0x2000c; const int opcodePCJoinFaction = 0x2000d; const int opcodeModDisposition = 0x200014d; + const int opcodeModDispositionExplicit = 0x200014e; void registerExtensions (Compiler::Extensions& extensions) { @@ -567,7 +574,8 @@ namespace MWScript extensions.registerInstruction("pcraiserank","/S",opcodePCRaiseRank); extensions.registerInstruction("pclowerrank","/S",opcodePCLowerRank); extensions.registerInstruction("pcjoinfaction","/S",opcodePCJoinFaction); - extensions.registerInstruction("moddisposition","l",opcodeModDisposition); + extensions.registerInstruction("moddisposition","l",opcodeModDisposition, + opcodeModDispositionExplicit); } void installOpcodes (Interpreter::Interpreter& interpreter) @@ -635,7 +643,8 @@ namespace MWScript interpreter.installSegment3(opcodePCRaiseRank,new OpPCRaiseRank); interpreter.installSegment3(opcodePCLowerRank,new OpPCLowerRank); interpreter.installSegment3(opcodePCJoinFaction,new OpPCJoinFaction); - interpreter.installSegment5(opcodeModDisposition,new OpModDisposition); + interpreter.installSegment5(opcodeModDisposition,new OpModDisposition); + interpreter.installSegment5(opcodeModDispositionExplicit,new OpModDisposition); } } }