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";).
This commit is contained in:
FishyClockwork 2016-10-29 15:52:29 +02:00 committed by Christoph Oelckers
parent f1a80770e1
commit c341bc0d3c

View file

@ -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;