From 87d164ee5917a02c3b69212a95755cca583228a9 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 16 Apr 2018 14:30:21 +0300 Subject: [PATCH] Added ability to set thing position in compatibility layer --- src/compatibility.cpp | 16 ++++++++++++++++ wadsrc/static/zscript/level_compatibility.txt | 1 + 2 files changed, 17 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 452360143..40d7bfbe2 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -375,6 +375,22 @@ DEFINE_ACTION_FUNCTION(DLevelCompatibility, SetThingSkills) return 0; } +DEFINE_ACTION_FUNCTION(DLevelCompatibility, SetThingXY) +{ + PARAM_PROLOGUE; + PARAM_INT(thing); + PARAM_FLOAT(x); + PARAM_FLOAT(y); + + if ((unsigned)thing < MapThingsConverted.Size()) + { + auto& pos = MapThingsConverted[thing].pos; + pos.X = x; + pos.Y = y; + } + return 0; +} + DEFINE_ACTION_FUNCTION(DLevelCompatibility, SetThingZ) { PARAM_PROLOGUE; diff --git a/wadsrc/static/zscript/level_compatibility.txt b/wadsrc/static/zscript/level_compatibility.txt index 6502ea69b..890872342 100644 --- a/wadsrc/static/zscript/level_compatibility.txt +++ b/wadsrc/static/zscript/level_compatibility.txt @@ -680,6 +680,7 @@ class LevelCompatibility play private static native void AddSectorTag(int sector, int tag); private static native void OffsetSectorPlane(int sector, int plane, double offset); private static native void SetThingSkills(int thing, int skills); + private static native void SetThingXY(int thing, double x, double y); private static native void SetThingZ(int thing, double z); private static native void SetThingFlags(int thing, int flags); private static native void SetVertex(uint vertex, double x, double y);