From 28847e4adf13072af495a18e00b0b1cfe9b3d58d Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 7 Oct 2024 20:40:41 +0200 Subject: [PATCH] test smol optimization P_CheckPosition --- src/p_map.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 0d8d29903..dd924f484 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1699,7 +1699,7 @@ static boolean PIT_CheckLine(line_t *ld) boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) { INT32 xl, xh, yl, yh, bx, by; - subsector_t *newsubsec; + subsector_t *newsubsec = thing->subsector; boolean blockval = true; ps_checkposition_calls.value.i++; @@ -1721,7 +1721,9 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) tmbbox[BOXRIGHT] = x + tmthing->radius; tmbbox[BOXLEFT] = x - tmthing->radius; - newsubsec = R_PointInSubsector(x, y); + if (thing->x != x || thing->y != y) + newsubsec = R_PointInSubsector(x, y); + ceilingline = blockingline = NULL; // The base floor / ceiling is from the subsector