diff --git a/src/compatibility.cpp b/src/compatibility.cpp index a510afe4b..4e44a407c 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -451,6 +451,54 @@ DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingCount) ACTION_RETURN_INT(MapThingsConverted.Size()); } +DEFINE_ACTION_FUNCTION(DLevelPostProcessor, GetThingEdNum) +{ + PARAM_SELF_PROLOGUE(DLevelPostProcessor); + PARAM_UINT(thing); + + const int result = thing < MapThingsConverted.Size() + ? 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 < MapThingsConverted.Size()) + { + auto &mti = 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 < MapThingsConverted.Size() + ? 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 < MapThingsConverted.Size()) + { + 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 5710a5ee3..4c47417e2 100644 --- a/wadsrc/static/zscript/level_postprocessor.zs +++ b/wadsrc/static/zscript/level_postprocessor.zs @@ -13,6 +13,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);