From 72e91786e2334f6683b9a6669f1790aeeff1b6ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 25 Jun 2013 23:36:24 +0200 Subject: [PATCH] - added SetThingZ compatibility option for fixing problems resulting from the changes to spawn position handling. --- src/compatibility.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 839d60dc5..cbbe12f73 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -80,6 +80,7 @@ enum CP_SETACTIVATION, CP_SECTORFLOOROFFSET, CP_SETWALLYSCALE, + CP_SETTHINGZ, }; // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -294,6 +295,15 @@ void ParseCompatibility() sc.MustGetFloat(); CompatParams.Push(FLOAT2FIXED(sc.Float)); } + else if (sc.Compare("setthingz")) + { + if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size(); + CompatParams.Push(CP_SETTHINGZ); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + sc.MustGetFloat(); + CompatParams.Push(FLOAT2FIXED(sc.Float)); + } else { sc.UnGet(); @@ -497,6 +507,16 @@ void SetCompatibilityParams() i += 5; break; } + case CP_SETTHINGZ: + { + // When this is called, the things haven't been spawned yet so we can alter the position inside the MapThings array. + if (CompatParams[i+1] < MapThingsConverted.Size()) + { + MapThingsConverted[CompatParams[i+1]].z = CompatParams[i+2]; + } + i += 3; + break; + } } } }