mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 15:15:31 +00:00
Implement getFactionReaction function
Strange bug when using value != 0 for the garbage argument?
This commit is contained in:
parent
e266c39c5d
commit
3e2eed9269
4 changed files with 26 additions and 1 deletions
|
@ -215,6 +215,27 @@ namespace MWScript
|
|||
}
|
||||
};
|
||||
|
||||
class OpGetFactionReaction : public Interpreter::Opcode0
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void execute (Interpreter::Runtime& runtime)
|
||||
{
|
||||
std::string faction1 = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
std::string faction2 = runtime.getStringLiteral (runtime[0].mInteger);
|
||||
runtime.pop();
|
||||
|
||||
// ignore extra garbage argument
|
||||
runtime.pop();
|
||||
|
||||
runtime.push(MWBase::Environment::get().getDialogueManager()
|
||||
->getFactionReaction(faction1, faction2));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
{
|
||||
interpreter.installSegment5 (Compiler::Dialogue::opcodeJournal, new OpJournal);
|
||||
|
@ -234,6 +255,7 @@ namespace MWScript
|
|||
interpreter.installSegment5 (Compiler::Dialogue::opcodeSameFaction, new OpSameFaction<ImplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Dialogue::opcodeSameFactionExplicit, new OpSameFaction<ExplicitRef>);
|
||||
interpreter.installSegment5 (Compiler::Dialogue::opcodeModFactionReaction, new OpModFactionReaction);
|
||||
interpreter.installSegment5 (Compiler::Dialogue::opcodeGetFactionReaction, new OpGetFactionReaction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -391,5 +391,6 @@ op 0x200023f: GetPcTraveling
|
|||
op 0x2000240: onKnockout
|
||||
op 0x2000241: onKnockoutExplicit
|
||||
op 0x2000242: ModFactionReaction
|
||||
op 0x2000243: GetFactionReaction
|
||||
|
||||
opcodes 0x2000243-0x3ffffff unused
|
||||
opcodes 0x2000244-0x3ffffff unused
|
||||
|
|
|
@ -180,6 +180,7 @@ namespace Compiler
|
|||
extensions.registerFunction("samefaction", 'l', "", opcodeSameFaction,
|
||||
opcodeSameFactionExplicit);
|
||||
extensions.registerInstruction("modfactionreaction", "ccl", opcodeModFactionReaction);
|
||||
extensions.registerFunction("getfactionreaction", 'l', "ccl", opcodeGetFactionReaction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -153,6 +153,7 @@ namespace Compiler
|
|||
const int opcodeSameFaction = 0x20001b5;
|
||||
const int opcodeSameFactionExplicit = 0x20001b6;
|
||||
const int opcodeModFactionReaction = 0x2000242;
|
||||
const int opcodeGetFactionReaction = 0x2000243;
|
||||
}
|
||||
|
||||
namespace Gui
|
||||
|
|
Loading…
Reference in a new issue