1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 18:45:38 +00:00

fixed handling of optional instruction/function arguments; removed choice workaround

This commit is contained in:
Marc Zinnschlag 2012-03-17 19:32:44 +01:00
parent f87bd65ae1
commit 187b8e58d6
2 changed files with 3 additions and 4 deletions

View file

@ -95,7 +95,6 @@ namespace MWScript
virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
{
arg0 = 4;
MWScript::InterpreterContext& context
= static_cast<MWScript::InterpreterContext&> (runtime.getContext());
MWDialogue::DialogueManager* dialogue = context.getEnvironment().mDialogueManager;
@ -129,7 +128,7 @@ namespace MWScript
extensions.registerInstruction ("setjournalindex", "cl", opcodeSetJournalIndex);
extensions.registerFunction ("getjournalindex", 'l', "c", opcodeGetJournalIndex);
extensions.registerInstruction ("addtopic", "S" , opcodeAddTopic);
extensions.registerInstruction ("choice", "/SlSl", opcodeChoice);
extensions.registerInstruction ("choice", "/SlSlSlSlSlSlSlSlSlSlSlSlSlSlSlSl", opcodeChoice);
}
void installOpcodes (Interpreter::Interpreter& interpreter)

View file

@ -639,7 +639,7 @@ namespace Compiler
std::vector<Interpreter::Type_Code>& code, bool invert)
{
bool optional = false;
bool optionalCount = 0;
int optionalCount = 0;
ExprParser parser (getErrorHandler(), getContext(), mLocals, mLiterals, true);
StringParser stringParser (getErrorHandler(), getContext(), mLiterals);