From 4c680808c1f9e67e50be6736776bc8ac7d6e5011 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 8 Dec 2024 04:21:50 +0100 Subject: [PATCH] dont always call R_PointInSubsector if thing has not moved R_PointInSubsector is quite expensive needs alot of testing --- src/p_map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 6c141eb16..782aac138 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1721,7 +1721,10 @@ 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 || thing->subsector == NULL) + newsubsec = R_PointInSubsector(x, y); + else + newsubsec = thing->subsector; ceilingline = blockingline = NULL;