From 803cb16d99ab9b34cd32df2a1e97e203d921b9c6 Mon Sep 17 00:00:00 2001 From: Chronos Ouroboros Date: Sat, 8 Dec 2018 15:56:06 -0200 Subject: [PATCH] Exported P_CheckFor3DFloorHit and P_CheckFor3DCeilingHit to ZScript. --- src/scripting/vmthunks_actors.cpp | 31 +++++++++++++++++++++++++++++++ wadsrc/static/zscript/actor.txt | 2 ++ 2 files changed, 33 insertions(+) diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index a067a296e..b366e679c 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -1587,6 +1587,37 @@ DEFINE_ACTION_FUNCTION_NATIVE(AKey, GetKeyType, P_GetKeyType) ACTION_RETURN_POINTER(P_GetKeyType(num)); } +//===================================================================================== +// +// 3D Floor exports +// +//===================================================================================== +int CheckFor3DFloorHit(AActor *self, double z, bool trigger) +{ + return P_CheckFor3DFloorHit(self, z, trigger); +} +DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckFor3DFloorHit, CheckFor3DFloorHit) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_FLOAT(z); + PARAM_BOOL(trigger); + + ACTION_RETURN_BOOL(P_CheckFor3DFloorHit(self, z, trigger)); +} + +int CheckFor3DCeilingHit(AActor *self, double z, bool trigger) +{ + return P_CheckFor3DCeilingHit(self, z, trigger); +} +DEFINE_ACTION_FUNCTION_NATIVE(AActor, CheckFor3DCeilingHit, CheckFor3DCeilingHit) +{ + PARAM_SELF_PROLOGUE(AActor); + PARAM_FLOAT(z); + PARAM_BOOL(trigger); + + ACTION_RETURN_BOOL(P_CheckFor3DCeilingHit(self, z, trigger)); +} + DEFINE_FIELD(AActor, snext) diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index 5bbcb452d..f95d145f3 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -623,6 +623,8 @@ class Actor : Thinker native native clearscope Actor GetPointer(int aaptr); native double BulletSlope(out FTranslatedLineTarget pLineTarget = null, int aimflags = 0); native void CheckFakeFloorTriggers (double oldz, bool oldz_has_viewheight = false); + native bool CheckFor3DFloorHit(double z, bool trigger); + native bool CheckFor3DCeilingHit(double z, bool trigger); native bool CheckMissileSpawn(double maxdist); native bool CheckPosition(Vector2 pos, bool actorsonly = false, FCheckPosition tm = null);