Merge commit 'b3f5de356f14e2026cc9e5738e8b58e22e7daa44'

This commit is contained in:
Braden Obrzut 2014-01-06 04:04:51 -05:00
commit bbd3106cbb

View file

@ -1747,10 +1747,20 @@ class CommandGameMode : public SBarInfoCommandFlowControl
void Parse(FScanner &sc, bool fullScreenOffsets) void Parse(FScanner &sc, bool fullScreenOffsets)
{ {
static bool warnUnknown = true;
do do
{ {
sc.MustGetToken(TK_Identifier); sc.MustGetToken(TK_Identifier);
modes |= static_cast<GameModes> (1<<sc.MustMatchString(modeNames)); int mode = sc.MatchString(modeNames);
if(mode >= 0)
modes |= static_cast<GameModes> (1<<mode);
else if(warnUnknown)
{
// Only warn about unknowns for cross port compatibility
// Also only warn once to keep logs from getting messy.
warnUnknown = false;
FScriptPosition(sc).Message(MSG_WARNING, "Ignoring unknown gamemode %s (future cases will be silently ignored).", sc.String);
}
} }
while(sc.CheckToken(',')); while(sc.CheckToken(','));
SBarInfoCommandFlowControl::Parse(sc, fullScreenOffsets); SBarInfoCommandFlowControl::Parse(sc, fullScreenOffsets);