From f58ed92bd05bb539a22357971d89a720aa40a951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustaf=20Alh=C3=A4ll?= Date: Sun, 17 Aug 2025 22:05:20 +0200 Subject: [PATCH] Fix collision misses on high coordinate values --- src/p_maputl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index a7ee27ce1..bba3e9776 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -1756,8 +1756,8 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, py2 -= bmaporgy; // blockmap traversal algorithm ported from antimony - int gridpos_x = px1 >> MAPBLOCKSHIFT; - int gridpos_y = py1 >> MAPBLOCKSHIFT; + int gridpos_x = (unsigned)px1 >> MAPBLOCKSHIFT; + int gridpos_y = (unsigned)py1 >> MAPBLOCKSHIFT; if (flags & PT_ADDLINES) if (!P_BlockLinesIterator(gridpos_x, gridpos_y, PIT_AddLineIntercepts)) return false; // early out @@ -1765,8 +1765,8 @@ boolean P_PathTraverse(fixed_t px1, fixed_t py1, fixed_t px2, fixed_t py2, if (!P_BlockThingsIterator(gridpos_x, gridpos_y, PIT_AddThingIntercepts)) return false; // early out - int endpos_x = px2 >> MAPBLOCKSHIFT; - int endpos_y = py2 >> MAPBLOCKSHIFT; + int endpos_x = (unsigned)px2 >> MAPBLOCKSHIFT; + int endpos_y = (unsigned)py2 >> MAPBLOCKSHIFT; if (gridpos_x == endpos_x && gridpos_y == endpos_y) return P_TraverseIntercepts(trav, FRACUNIT);