From 88aafd9df2661bd238a54f5166e40018b1f35202 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 4 Dec 2024 14:39:57 +0100 Subject: [PATCH] TEST: dont keep calling R_PointInSubsector in P_CheckPosition if the postiion never changes can just reuse the thing subsector might speed things up quite a bit actually test: cause idk if it is actually compeltely netsafe --- 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;