diff --git a/Source/Core/ZDoom/SndInfoParser.cs b/Source/Core/ZDoom/SndInfoParser.cs index f4922777..e1cdb428 100755 --- a/Source/Core/ZDoom/SndInfoParser.cs +++ b/Source/Core/ZDoom/SndInfoParser.cs @@ -17,6 +17,14 @@ namespace CodeImp.DoomBuilder.ZDoom private Dictionary ambientsounds; private Dictionary sounds; private SoundInfo globalprops; + + // There are two formats supported, with the old format being + // logicalname lumpname + // and the new format being + // logicalname = lumpname + // Only one format may be used + private enum SndInfoFormat { None, Old, New } + private SndInfoFormat format = SndInfoFormat.None; #endregion @@ -390,6 +398,17 @@ namespace CodeImp.DoomBuilder.ZDoom logicalname = StripTokenQuotes(logicalname); if(string.IsNullOrEmpty(logicalname)) return false; + // Check sound assignment format and report an error if both the old and new format is used + if ((format == SndInfoFormat.New && !NextTokenIs("=", false)) || (format == SndInfoFormat.Old && NextTokenIs("=", false))) + { + ReportError("Mixing old and new sound assignment format is not permitted"); + return false; + } + else if(format == SndInfoFormat.None) + { + format = NextTokenIs("=", false) ? SndInfoFormat.New : SndInfoFormat.Old; + } + // Read lumpname if(!SkipWhitespace(true)) return false; string lumpname = StripTokenQuotes(ReadToken());