From c341bc0d3c127cc0a03c2130b1c2ab2e01071a07 Mon Sep 17 00:00:00 2001 From: FishyClockwork Date: Sat, 29 Oct 2016 15:52:29 +0200 Subject: [PATCH] Added restriction of Require/Exclude to ZSDF Added restriction of Require/Exclude to ZSDF (namespace = "ZDoom";). A warning will be printed if a Require/Exclude block is detected in USDF (namespace = "Strife";). --- src/p_usdf.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index 245240273..e8ce5ca50 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -210,9 +210,17 @@ class USDFParser : public UDMFParserBase { switch(key) { - case NAME_Cost: case NAME_Require: case NAME_Exclude: + // Print a warning if the namespace is not ZDoom otherwise fall-through. [FishyClockwork] + if (namespace_bits != Zd) + { + sc.ScriptMessage("Detected \"%s\" block, ignoring. Require/Exclude are exclusive to namespace ZDoom.", key == NAME_Require ? "Require" : "Exclude"); + while (!sc.CheckToken('}')) sc.MustGetAnyToken(); // Skip this block + break; + } + + case NAME_Cost: ParseCostRequireExclude(reply, key); break;