summaryrefslogtreecommitdiff
path: root/src/game/world
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-04 00:36:03 +0100
committeraura <nw@moneybot.cc>2026-03-04 00:36:03 +0100
commit88f960570aed4e12046d8a3c0924129d4fbd96a8 (patch)
treef68e7fa2d28577bb9e0a939d70cc7ec029003bfd /src/game/world
parent333b457d30966fceb50fd420a559ae7d0aa3dad6 (diff)
minor fix pt2
Diffstat (limited to 'src/game/world')
-rw-r--r--src/game/world/trace.cpp14
1 files changed, 3 insertions, 11 deletions
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;
}