diff --git a/src/p_map.cpp b/src/p_map.cpp index ea4031eb48..7cab335c09 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2784,9 +2784,8 @@ DEFINE_ACTION_FUNCTION(AActor, TryMove) // //========================================================================== -bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) +static bool P_CheckMove(AActor *thing, const DVector2 &pos, FCheckPosition& tm, int flags) { - FCheckPosition tm; double newz = thing->Z(); auto f1 = thing->flags & MF_PICKUP; @@ -2879,13 +2878,27 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) return true; } +bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags) +{ + FCheckPosition tm; + return P_CheckMove(thing, pos, tm, flags); +} + DEFINE_ACTION_FUNCTION(AActor, CheckMove) { PARAM_SELF_PROLOGUE(AActor); PARAM_FLOAT(x); PARAM_FLOAT(y); PARAM_INT_DEF(flags); - ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); + PARAM_POINTER_DEF(tm, FCheckPosition); + if (tm == nullptr) + { + ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), flags)); + } + else + { + ACTION_RETURN_BOOL(P_CheckMove(self, DVector2(x, y), *tm, flags)); + } } diff --git a/wadsrc/static/zscript/actor.txt b/wadsrc/static/zscript/actor.txt index d9847e2b14..6dd222fbfc 100644 --- a/wadsrc/static/zscript/actor.txt +++ b/wadsrc/static/zscript/actor.txt @@ -624,7 +624,7 @@ class Actor : Thinker native } native bool TryMove(vector2 newpos, int dropoff, bool missilecheck = false, FCheckPosition tm = null); - native bool CheckMove(vector2 newpos, int flags = 0); + native bool CheckMove(vector2 newpos, int flags = 0, FCheckPosition tm = null); native void NewChaseDir(); native void RandomChaseDir(); native bool CheckMissileRange();