From 580e580c429885a34d2770fd8a10426510e0eef1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 8 Sep 2014 22:54:56 +0200 Subject: [PATCH] - added option to set a sector's tag via compatibility.txt (needed by GZDoom) --- src/compatibility.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 7339a0f19..c2153fbd7 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -81,6 +81,7 @@ enum CP_SECTORFLOOROFFSET, CP_SETWALLYSCALE, CP_SETTHINGZ, + CP_SETTAG, }; // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -307,6 +308,15 @@ void ParseCompatibility() sc.MustGetFloat(); CompatParams.Push(FLOAT2FIXED(sc.Float)); } + else if (sc.Compare("setsectortag")) + { + if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size(); + CompatParams.Push(CP_SETTAG); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + } else { sc.UnGet(); @@ -520,6 +530,14 @@ void SetCompatibilityParams() i += 3; break; } + case CP_SETTAG: + { + if ((unsigned)CompatParams[i + 1] < (unsigned)numsectors) + { + sectors[CompatParams[i + 1]].tag = CompatParams[i + 2]; + } + break; + } } } }