mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- Fixed: SBarInfo's gamemode command used to ignore unknowns (for cross compatibility). On top of restoring the old behavior, generate a warning for only the first ignored instance.
This commit is contained in:
parent
511bdc7208
commit
b3f5de356f
1 changed files with 11 additions and 1 deletions
|
@ -1639,10 +1639,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);
|
||||||
|
|
Loading…
Reference in a new issue