From 88f960570aed4e12046d8a3c0924129d4fbd96a8 Mon Sep 17 00:00:00 2001 From: aura Date: Wed, 4 Mar 2026 00:36:03 +0100 Subject: minor fix pt2 --- src/game/world/trace.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/game/world/trace.cpp b/src/game/world/trace.cpp index 56d0a4b..3207a3e 100644 --- a/src/game/world/trace.cpp +++ b/src/game/world/trace.cpp @@ -203,17 +203,9 @@ inline U8 point_in_inflated_poly( if( dist < -( expand - BSP_EDGE_TOLERANCE ) ) return 0; - U8 isaxis = 0; - for( U32 i = 0; i < 3; ++i ) { - if( norm == vec3_axis[i] || norm == (vec3_axis[i] * -1.f) ) { - isaxis = 1; break; - } - } - - // for non-axis-aligned faces the point of contact is infinitely thin - // todo : this isnt foolproof, check for hit direction if it comes from up/down - // just ignore this, only apply to walls - if( !isaxis ) { + // check if plane is aligned to any hull edge in x/y plane + if( fabsf( norm.x ) >= BSP_TRACE_EPSILON && fabsf( norm.y ) >= BSP_TRACE_EPSILON ) { + // for non-axis-aligned faces the point of contact is infinitely thin if( dist < BSP_EDGE_TOLERANCE ) return 0; } -- cgit v1.2.3