diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index c23697b53..efc873475 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3515,6 +3515,54 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingFlags) return 0; } +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingSpecial) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + + const int result = thing < self->loader->MapThingsConverted.Size() + ? self->loader->MapThingsConverted[thing].special : 0; + ACTION_RETURN_INT(result); +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingSpecial) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_INT(special); + + if (thing < self->loader->MapThingsConverted.Size()) + { + self->loader->MapThingsConverted[thing].special = special; + } + return 0; +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingArgument) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_UINT(index); + + const int result = index < 5 && thing < self->loader->MapThingsConverted.Size() + ? self->loader->MapThingsConverted[thing].args[index] : 0; + ACTION_RETURN_INT(result); +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_UINT(index); + PARAM_INT(value); + + if (index < 5 && thing < self->loader->MapThingsConverted.Size()) + { + self->loader->MapThingsConverted[thing].args[index] = value; + } + return 0; +} + DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetVertex) { PARAM_SELF_PROLOGUE(DLevelPostProcessor); diff --git a/wadsrc/static/zscript/level_postprocessor.zs b/wadsrc/static/zscript/level_postprocessor.zs index 9e76c1a31..3c38da6b0 100644 --- a/wadsrc/static/zscript/level_postprocessor.zs +++ b/wadsrc/static/zscript/level_postprocessor.zs @@ -31,6 +31,12 @@ class LevelPostProcessor native play protected native uint GetThingFlags(uint thing); protected native void SetThingFlags(uint thing, uint flags); + protected native int GetThingSpecial(uint thing); + protected native void SetThingSpecial(uint thing, int special); + + protected native int GetThingArgument(uint thing, uint index); + protected native void SetThingArgument(uint thing, uint index, int value); + protected native void SetVertex(uint vertex, double x, double y); protected native void SetLineSectorRef(uint line, uint side, uint sector); protected native Actor GetDefaultActor(Name actorclass);