1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 12:09:43 +00:00

Merge pull request #2894 from Capostrophic/disable

Ignore bogus string arguments for Disable/Enable again
This commit is contained in:
Andrei Kortunov 2020-06-07 10:15:12 +04:00 committed by GitHub
commit 52d27dee5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 13 deletions

View file

@ -247,8 +247,8 @@ namespace Compiler
extensions.registerInstruction ("startscript", "c", opcodeStartScript, opcodeStartScriptExplicit);
extensions.registerInstruction ("stopscript", "c", opcodeStopScript);
extensions.registerFunction ("getsecondspassed", 'f', "", opcodeGetSecondsPassed);
extensions.registerInstruction ("enable", "", opcodeEnable, opcodeEnableExplicit);
extensions.registerInstruction ("disable", "", opcodeDisable, opcodeDisableExplicit);
extensions.registerInstruction ("enable", "x", opcodeEnable, opcodeEnableExplicit);
extensions.registerInstruction ("disable", "x", opcodeDisable, opcodeDisableExplicit);
extensions.registerFunction ("getdisabled", 'l', "x", opcodeGetDisabled, opcodeGetDisabledExplicit);
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate, opcodeOnActivateExplicit);

View file

@ -86,13 +86,6 @@ namespace Compiler
bool LineParser::parseName (const std::string& name, const TokenLoc& loc,
Scanner& scanner)
{
if (mState==PotentialEndState)
{
getErrorHandler().warning ("Stray string argument", loc);
mState = EndState;
return true;
}
if (mState==SetState)
{
std::string name2 = Misc::StringUtils::lowerCase (name);
@ -445,8 +438,7 @@ namespace Compiler
return true;
}
if (code==Scanner::S_newline &&
(mState==EndState || mState==BeginState || mState==PotentialEndState))
if (code==Scanner::S_newline && (mState==EndState || mState==BeginState))
return false;
if (code==Scanner::S_comma && mState==MessageState)

View file

@ -25,8 +25,7 @@ namespace Compiler
SetState, SetLocalVarState, SetGlobalVarState, SetPotentialMemberVarState,
SetMemberVarState, SetMemberVarState2,
MessageState, MessageCommaState, MessageButtonState, MessageButtonCommaState,
EndState, PotentialEndState /* may have a stray string argument */,
PotentialExplicitState, ExplicitState, MemberState
EndState, PotentialExplicitState, ExplicitState, MemberState
};
Locals& mLocals;