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
This commit is contained in:
Alug committed 2024-12-04 14:39:57 +01:00
1 parent 76bb99422a
commit 88aafd9df2
1 file changed
+4 -1
+4 -1
View File
@@ -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;