From 964534f4b0c2e30ef772aa934c6e731601fa97ac Mon Sep 17 00:00:00 2001 From: Boondorl <59555366+Boondorl@users.noreply.github.com> Date: Fri, 25 Nov 2022 11:39:27 -0500 Subject: [PATCH] Added Method For Getting Portal Group Count --- src/scripting/vmthunks.cpp | 6 ++++++ wadsrc/static/zscript/doombase.zs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 0b0391bd0..0569dc20c 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -2436,6 +2436,12 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, GetDisplacement) ACTION_RETURN_VEC2(ofs); } +DEFINE_ACTION_FUNCTION(FLevelLocals, GetPortalGroupCount) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + ACTION_RETURN_INT(self->Displacements.size); +} + void SphericalCoords(FLevelLocals *self, double vpX, double vpY, double vpZ, double tX, double tY, double tZ, double viewYaw, double viewPitch, int absolute, DVector3 *result) { diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 5425c7b00..7e8190ba2 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -492,6 +492,7 @@ struct LevelLocals native native clearscope vector3 Vec2OffsetZ(vector2 pos, vector2 dir, double atz, bool absolute = false) const; native clearscope vector3 Vec3Offset(vector3 pos, vector3 dir, bool absolute = false) const; native clearscope Vector2 GetDisplacement(int pg1, int pg2) const; + native clearscope int GetPortalGroupCount() const; native String GetChecksum() const;