summaryrefslogtreecommitdiff
path: root/src/game/world/trace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/world/trace.cpp')
-rw-r--r--src/game/world/trace.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game/world/trace.cpp b/src/game/world/trace.cpp
index 0cd720d..2cf2a81 100644
--- a/src/game/world/trace.cpp
+++ b/src/game/world/trace.cpp
@@ -198,11 +198,10 @@ inline U8 point_in_inflated_poly(
const AABB& hull,
const VEC3& norm
){
- VEC3 center{};
U32 c = face->verts.size;
- for( U32 i = 0; i < c; ++i )
- center = center + face->verts.data[i].pos;
- if( c ) center = center * (1.0f / c);
+ VEC3 center = face->center;
+ if( !c )
+ return 0;
VEC3 hullh = ( hull.max - hull.min ) * 0.5f;
for( U32 i = 0; i < c; ++i ) {