diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 5d0017bff..56688fd06 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -163,7 +163,7 @@ bool P_CanCollideWith(AActor *tmthing, AActor *thing) // If false, the line blocks them. //========================================================================== -bool P_CanCrossLine(AActor *mo, line_t *line, int side) +bool P_CanCrossLine(AActor *mo, line_t *line, int side, DVector3 next) { static unsigned VIndex = ~0u; if (VIndex == ~0u) @@ -172,7 +172,7 @@ bool P_CanCrossLine(AActor *mo, line_t *line, int side) assert(VIndex != ~0u); } - VMValue params[4] = { mo, line, side, false }; + VMValue params[] = { mo, line, side, next.X, next.Y, next.Z, false }; VMReturn ret; int retval; ret.IntAt(&retval); @@ -181,7 +181,7 @@ bool P_CanCrossLine(AActor *mo, line_t *line, int side) VMFunction *func = clss->Virtuals.Size() > VIndex ? clss->Virtuals[VIndex] : nullptr; if (func != nullptr) { - VMCall(func, params, 4, &ret, 1); + VMCall(func, params, countof(params), &ret, 1); return retval; } return true; @@ -985,7 +985,7 @@ bool PIT_CheckLine(FMultiBlockLinesIterator &mit, FMultiBlockLinesIterator::Chec } } - if (!P_CanCrossLine(tm.thing, ld, P_PointOnLineSide(cres.Position, ld))) + if (!P_CanCrossLine(tm.thing, ld, P_PointOnLineSide(cres.Position, ld), tm.pos)) { if (wasfit) tm.thing->BlockingLine = ld; diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index 297205598..1c702e9d5 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -502,7 +502,7 @@ class Actor : Thinker native } // Called by PIT_CheckLine to check if an actor can cross a line. - virtual bool CanCrossLine(Line crossing, int side) + virtual bool CanCrossLine(Line crossing, int side, Vector3 next) { return true; }