diff --git a/src/maploader/maploader.cpp b/src/maploader/maploader.cpp index 298e5c81fa..c23697b532 100644 --- a/src/maploader/maploader.cpp +++ b/src/maploader/maploader.cpp @@ -3381,6 +3381,54 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingCount) ACTION_RETURN_INT(self->loader->MapThingsConverted.Size()); } +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingEdNum) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + + const int result = thing < self->loader->MapThingsConverted.Size() + ? self->loader->MapThingsConverted[thing].EdNum : 0; + ACTION_RETURN_INT(result); +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingEdNum) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_UINT(ednum); + + if (thing < self->loader->MapThingsConverted.Size()) + { + auto &mti = self->loader->MapThingsConverted[thing]; + mti.EdNum = ednum; + mti.info = DoomEdMap.CheckKey(ednum); + } + return 0; +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingAngle) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + + const int result = thing < self->loader->MapThingsConverted.Size() + ? self->loader->MapThingsConverted[thing].angle : 0; + ACTION_RETURN_INT(result); +} + +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, SetThingAngle) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + PARAM_UINT(angle); + + if (thing < self->loader->MapThingsConverted.Size()) + { + self->loader->MapThingsConverted[thing].angle = angle; + } + return 0; +} + DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingSkills) { PARAM_SELF_PROLOGUE(DLevelPostProcessor); diff --git a/wadsrc/static/zscript/level_postprocessor.zs b/wadsrc/static/zscript/level_postprocessor.zs index 57d5672ec2..9e76c1a319 100644 --- a/wadsrc/static/zscript/level_postprocessor.zs +++ b/wadsrc/static/zscript/level_postprocessor.zs @@ -15,6 +15,12 @@ class LevelPostProcessor native play protected native uint GetThingCount(); + protected native int GetThingEdNum(uint thing); + protected native void SetThingEdNum(uint thing, int ednum); + + protected native int GetThingAngle(uint thing); + protected native void SetThingAngle(uint thing, int angle); + protected native uint GetThingSkills(uint thing); protected native void SetThingSkills(uint thing, uint skills);