diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index 54d778e89..234f67d8c 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -632,9 +632,9 @@ namespace MWScript }; - class OpShowVarsExplicit : public Interpreter::Opcode0 + template + class OpShowVars : public Interpreter::Opcode0 { - protected: void printLocalVars(Interpreter::Runtime &runtime, const MWWorld::Ptr &ptr) { std::stringstream str; @@ -675,16 +675,6 @@ namespace MWScript runtime.getContext().report(str.str()); } - public: - virtual void execute (Interpreter::Runtime& runtime) - { - MWWorld::Ptr ptr = ExplicitRef()(runtime); - printLocalVars(runtime, ptr); - } - }; - - class OpShowVarsImplicit : public OpShowVarsExplicit - { void printGlobalVars(Interpreter::Runtime &runtime) { std::stringstream str; @@ -701,8 +691,6 @@ namespace MWScript str<); interpreter.installSegment5 (Compiler::Misc::opcodeDisableTeleporting, new OpEnableTeleporting); interpreter.installSegment5 (Compiler::Misc::opcodeEnableTeleporting, new OpEnableTeleporting); - interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVarsImplicit); - interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVarsExplicit); + interpreter.installSegment5 (Compiler::Misc::opcodeShowVars, new OpShowVars); + interpreter.installSegment5 (Compiler::Misc::opcodeShowVarsExplicit, new OpShowVars); } } }