mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
Ignore bogus string arguments for Disable/Enable again
This commit is contained in:
parent
05884e690f
commit
e02b66cdf4
@ -247,8 +247,8 @@ namespace Compiler
|
|||||||
extensions.registerInstruction ("startscript", "c", opcodeStartScript, opcodeStartScriptExplicit);
|
extensions.registerInstruction ("startscript", "c", opcodeStartScript, opcodeStartScriptExplicit);
|
||||||
extensions.registerInstruction ("stopscript", "c", opcodeStopScript);
|
extensions.registerInstruction ("stopscript", "c", opcodeStopScript);
|
||||||
extensions.registerFunction ("getsecondspassed", 'f', "", opcodeGetSecondsPassed);
|
extensions.registerFunction ("getsecondspassed", 'f', "", opcodeGetSecondsPassed);
|
||||||
extensions.registerInstruction ("enable", "", opcodeEnable, opcodeEnableExplicit);
|
extensions.registerInstruction ("enable", "x", opcodeEnable, opcodeEnableExplicit);
|
||||||
extensions.registerInstruction ("disable", "", opcodeDisable, opcodeDisableExplicit);
|
extensions.registerInstruction ("disable", "x", opcodeDisable, opcodeDisableExplicit);
|
||||||
extensions.registerFunction ("getdisabled", 'l', "x", opcodeGetDisabled, opcodeGetDisabledExplicit);
|
extensions.registerFunction ("getdisabled", 'l', "x", opcodeGetDisabled, opcodeGetDisabledExplicit);
|
||||||
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
||||||
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate, opcodeOnActivateExplicit);
|
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate, opcodeOnActivateExplicit);
|
||||||
|
@ -86,13 +86,6 @@ namespace Compiler
|
|||||||
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
|
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
|
||||||
Scanner& scanner)
|
Scanner& scanner)
|
||||||
{
|
{
|
||||||
if (mState==PotentialEndState)
|
|
||||||
{
|
|
||||||
getErrorHandler().warning ("Stray string argument", loc);
|
|
||||||
mState = EndState;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mState==SetState)
|
if (mState==SetState)
|
||||||
{
|
{
|
||||||
std::string name2 = Misc::StringUtils::lowerCase (name);
|
std::string name2 = Misc::StringUtils::lowerCase (name);
|
||||||
@ -445,8 +438,7 @@ namespace Compiler
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code==Scanner::S_newline &&
|
if (code==Scanner::S_newline && (mState==EndState || mState==BeginState))
|
||||||
(mState==EndState || mState==BeginState || mState==PotentialEndState))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (code==Scanner::S_comma && mState==MessageState)
|
if (code==Scanner::S_comma && mState==MessageState)
|
||||||
|
@ -25,8 +25,7 @@ namespace Compiler
|
|||||||
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
|
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
|
||||||
SetMemberVarState, SetMemberVarState2,
|
SetMemberVarState, SetMemberVarState2,
|
||||||
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
|
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
|
||||||
EndState, PotentialEndState /* may have a stray string argument */,
|
EndState, PotentialExplicitState, ExplicitState, MemberState
|
||||||
PotentialExplicitState, ExplicitState, MemberState
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Locals& mLocals;
|
Locals& mLocals;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user