diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 279f331e1..c7524f43f 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3599,6 +3599,29 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingArgument) return 0; } +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingID) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + + const int id = thing < self->loader->MapThingsConverted.Size() + ? self->loader->MapThingsConverted[thing].thingid : 0; + ACTION_RETURN_INT(id); +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingID) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_INT(id); + + if (thing < self->loader->MapThingsConverted.Size()) + { + self->loader->MapThingsConverted[thing].thingid = id; + } + 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 29a747310..e1f05bec7 100644 --- a/wadsrc/static/zscript/level_postprocessor.zs +++ b/wadsrc/static/zscript/level_postprocessor.zs @@ -35,6 +35,9 @@ class LevelPostProcessor native play protected native uint GetThingFlags(uint thing); protected native void SetThingFlags(uint thing, uint flags); + protected native int GetThingID(uint thing); + protected native void SetThingID(uint thing, int id); + protected native int GetThingSpecial(uint thing); protected native void SetThingSpecial(uint thing, int special);