diff --git a/Source/Core/ZDoom/CvarInfoParser.cs b/Source/Core/ZDoom/CvarInfoParser.cs index f709c839..48832887 100755 --- a/Source/Core/ZDoom/CvarInfoParser.cs +++ b/Source/Core/ZDoom/CvarInfoParser.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Globalization; +using System.IO; using CodeImp.DoomBuilder.Config; using CodeImp.DoomBuilder.Data; using CodeImp.DoomBuilder.Rendering; @@ -51,26 +52,35 @@ namespace CodeImp.DoomBuilder.ZDoom // Continue until at the end of the stream HashSet knowntypes = new HashSet { "int", "float", "color", "bool", "string" }; + HashSet flags = new HashSet { "noarchive", "cheat", "latch" }; while(SkipWhitespace(true)) { string token = ReadToken().ToLowerInvariant(); if(string.IsNullOrEmpty(token)) continue; - // [noarchive] [= ]; + // [noarchive] [cheat] [latch] [= ]; switch(token) { case "user": case "server": + // read (skip) flags + while(true) + { + string flagtoken; + + SkipWhitespace(true); + flagtoken = ReadToken().ToLowerInvariant(); + + if(!flags.Contains(flagtoken)) + { + DataStream.Seek(-flagtoken.Length - 1, SeekOrigin.Current); + break; + } + } + // Type SkipWhitespace(true); string type = ReadToken().ToLowerInvariant(); - // Can be "noarchive" keyword - if(type == "noarchive") - { - SkipWhitespace(true); - type = ReadToken().ToLowerInvariant(); - } - if(!knowntypes.Contains(type)) { ReportError("Unknown cvar type");