Skip to content

Commit

Permalink
"Handle" RepairedOnMe scripting function (feature #4255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Capostrophic committed Jun 2, 2019
1 parent f0640cb commit b7afb21
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
Feature #3999: Shift + Double Click should maximize/restore menu size
Feature #4001: Toggle sneak controller shortcut
Feature #4209: Editor: Faction rank sub-table
Feature #4255: Handle broken RepairedOnMe script function
Feature #4316: Implement RaiseRank/LowerRank functions properly
Feature #4360: Improve default controller bindings
Feature #4673: Weapon sheathing
Expand Down
2 changes: 2 additions & 0 deletions apps/openmw/mwscript/docs/vmformat.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,5 +459,7 @@ op 0x2000308: ToggleNavMesh
op 0x2000309: ToggleActorsPaths
op 0x200030a: SetNavMeshNumber
op 0x200030b: Journal, explicit
op 0x200030c: RepairedOnMe
op 0x200030d: RepairedOnMe, explicit

opcodes 0x200030c-0x3ffffff unused
14 changes: 14 additions & 0 deletions apps/openmw/mwscript/miscextensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,18 @@ namespace MWScript
}
};

template <class R>
class OpRepairedOnMe : public Interpreter::Opcode0
{
public:

virtual void execute (Interpreter::Runtime& runtime)
{
// Broken in vanilla and deliberately no-op.
runtime.push(0);
}
};

void installOpcodes (Interpreter::Interpreter& interpreter)
{
interpreter.installSegment5 (Compiler::Misc::opcodeXBox, new OpXBox);
Expand Down Expand Up @@ -1501,6 +1513,8 @@ namespace MWScript
interpreter.installSegment5 (Compiler::Misc::opcodeToggleNavMesh, new OpToggleNavMesh);
interpreter.installSegment5 (Compiler::Misc::opcodeToggleActorsPaths, new OpToggleActorsPaths);
interpreter.installSegment5 (Compiler::Misc::opcodeSetNavMeshNumberToRender, new OpSetNavMeshNumberToRender);
interpreter.installSegment5 (Compiler::Misc::opcodeRepairedOnMe, new OpRepairedOnMe<ImplicitRef>);
interpreter.installSegment5 (Compiler::Misc::opcodeRepairedOnMeExplicit, new OpRepairedOnMe<ExplicitRef>);
}
}
}
1 change: 1 addition & 0 deletions components/compiler/extensions0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ namespace Compiler
extensions.registerInstruction ("tap", "", opcodeToggleActorsPaths);
extensions.registerInstruction ("toggleactorspaths", "", opcodeToggleActorsPaths);
extensions.registerInstruction ("setnavmeshnumber", "l", opcodeSetNavMeshNumberToRender);
extensions.registerFunction ("repairedonme", 'l', "S", opcodeRepairedOnMe, opcodeRepairedOnMeExplicit);
}
}

Expand Down
2 changes: 2 additions & 0 deletions components/compiler/opcodes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ namespace Compiler
const int opcodeToggleNavMesh = 0x2000308;
const int opcodeToggleActorsPaths = 0x2000309;
const int opcodeSetNavMeshNumberToRender = 0x200030a;
const int opcodeRepairedOnMe = 0x200030c;
const int opcodeRepairedOnMeExplicit = 0x200030d;
}

namespace Sky
Expand Down

0 comments on commit b7afb21

Please sign in to comment.