diff --git a/Build/Configurations/Includes/Doom_things.cfg b/Build/Configurations/Includes/Doom_things.cfg index 5f8fae8bd52d45b00b2e69f49bb4aeb49097d6bc..f56d6d8099edb7c0735a48f834d98e7f78a4461d 100644 --- a/Build/Configurations/Includes/Doom_things.cfg +++ b/Build/Configurations/Includes/Doom_things.cfg @@ -543,9 +543,9 @@ obstacles 47 { - title = "Stalagmite"; + title = "Stalagtite"; sprite = "SMITA0"; - class = "Stalagmite"; + class = "Stalagtite"; } 43 diff --git a/Build/Configurations/Includes/ZDoom_things.cfg b/Build/Configurations/Includes/ZDoom_things.cfg index 1b824e49699c7dfa2529f5265fb535171b375b50..2dd37261eb3618b2ee2750b0335272d30a3bd3ab 100644 --- a/Build/Configurations/Includes/ZDoom_things.cfg +++ b/Build/Configurations/Includes/ZDoom_things.cfg @@ -35,6 +35,15 @@ zdoom obstacles { blocking = 2; + + 5050 + { + title = "Stalagmite"; + sprite = "SMT2A0"; + class = "Stalagmite"; + width = 16; + height = 48; + } } lights @@ -1469,16 +1478,6 @@ doom { blocking = 2; } - - 5050 // Stalagmite - { - blocking = 2; - title = "Stalagmite"; - sprite = "SMT2A0"; - class = "Stalagmite"; - width = 16; - height = 48; - } } weapons diff --git a/Source/Core/IO/UniversalParser.cs b/Source/Core/IO/UniversalParser.cs index 791a8686db8637f3b184f4ed5a9d253d0492be9c..c3a7f2900e8c2fafae14f1f5883255576de3bd41 100644 --- a/Source/Core/IO/UniversalParser.cs +++ b/Source/Core/IO/UniversalParser.cs @@ -21,7 +21,6 @@ using System.IO; using System.Text; using System.Globalization; using System.Collections.Generic; -using CodeImp.DoomBuilder.Map; #endregion @@ -141,32 +140,32 @@ namespace CodeImp.DoomBuilder.IO // error properties if key is invalid and errorline > -1 private bool ValidateKey(string key, int errorline) { - bool validateresult = true; - // Check if key is an empty string if(key.Length == 0) { // ERROR: Missing key name in statement if(errorline > -1) RaiseError(errorline, ERROR_KEYMISSING); - validateresult = false; + return false; } - else if(strictchecking) //Only when strict checking + + //Only when strict checking + if(strictchecking) { // Check if all characters are valid - foreach(char c in key) + string keylc = key.ToLowerInvariant(); //mxd. UDMF key names are case-insensitive + foreach(char c in keylc) { if(KEY_CHARACTERS.IndexOf(c) == -1) { // ERROR: Invalid characters in key name if(errorline > -1) RaiseError(errorline, ERROR_KEYCHARACTERS); - validateresult = false; - break; + return false; } } } - // Return result - return validateresult; + // Key is valid + return true; } diff --git a/Source/Core/ZDoom/AnimdefsParser.cs b/Source/Core/ZDoom/AnimdefsParser.cs index ff9941afed956b2c8a0fc76b76e4c0c7cfa48100..944e7094afada16dc55019d26fd44df680e20c0b 100644 --- a/Source/Core/ZDoom/AnimdefsParser.cs +++ b/Source/Core/ZDoom/AnimdefsParser.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; +using CodeImp.DoomBuilder.Data; #endregion @@ -58,8 +59,15 @@ namespace CodeImp.DoomBuilder.ZDoom string texturename = StripTokenQuotes(ReadToken(false)); if(string.IsNullOrEmpty(texturename)) { - ReportError("Expected camera texture name"); - break; + ReportError("expected camera texture name"); + return false; + } + + // Camera texture names are limited to 8 chars + if(texturename.Length > DataManager.CLASIC_IMAGE_NAME_LENGTH) + { + ReportError("camera texture names must be no longer than " + DataManager.CLASIC_IMAGE_NAME_LENGTH + " chars"); + return false; } // Width @@ -67,8 +75,8 @@ namespace CodeImp.DoomBuilder.ZDoom SkipWhitespace(true); if(!ReadSignedInt(ref width) || width < 1) { - ReportError("Expected camera texture width"); - break; + ReportError("expected camera texture width"); + return false; } // Height @@ -76,8 +84,8 @@ namespace CodeImp.DoomBuilder.ZDoom SkipWhitespace(true); if(!ReadSignedInt(ref height) || height < 1) { - ReportError("Expected camera texture height"); - break; + ReportError("expected camera texture height"); + return false; } // "Fit" keyword? @@ -96,16 +104,16 @@ namespace CodeImp.DoomBuilder.ZDoom SkipWhitespace(true); if(!ReadSignedInt(ref fitwidth) || fitwidth < 1) { - ReportError("Expected camera texture fit width"); - break; + ReportError("expected camera texture fit width"); + return false; } // Fit height SkipWhitespace(true); if(!ReadSignedInt(ref fitheight) || fitheight < 1) { - ReportError("Expected camera texture fit height"); - break; + ReportError("expected camera texture fit height"); + return false; } // Update scale @@ -124,7 +132,7 @@ namespace CodeImp.DoomBuilder.ZDoom if(cameratextures.ContainsKey(texturename.ToUpperInvariant())) { ReportError("Camera texture '" + texturename + "' is defined more than once"); - break; + return false; } // Store results