From 333b457d30966fceb50fd420a559ae7d0aa3dad6 Mon Sep 17 00:00:00 2001 From: aura Date: Wed, 4 Mar 2026 00:08:05 +0100 Subject: minor fix --- src/game/physics/movement.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/game/physics/movement.cpp') diff --git a/src/game/physics/movement.cpp b/src/game/physics/movement.cpp index 61b1cc4..fce9d73 100644 --- a/src/game/physics/movement.cpp +++ b/src/game/physics/movement.cpp @@ -291,7 +291,7 @@ void gmove_check_stuck( VEC3* in_pos ) { gmove->unstuck_vel = { 0, 0, 1.f }; bsp_trace( &t, gmove->bsp, gmove->aabb, pos, pos ); - if( !t.hit ) { + if( !t.hit || !t.startsolid ) { if( vec_len( gmove->velocity ) > 1.f ) { gmove->unstuck_pos = pos; gmove->unstuck_vel = gmove->velocity; @@ -299,6 +299,18 @@ void gmove_check_stuck( VEC3* in_pos ) { return; } + for( U32 i = 0; i < 3; ++i ) { + VEC3 dir = vec3_axis[i]; + VEC3 nudge = pos + dir; + bsp_trace( &t, gmove->bsp, gmove->aabb, pos, nudge ); + if( !t.hit || !t.startsolid ) + return; // not actually stuck, just somewhat inside a solid + + nudge = pos + dir * -1.f; + if( !t.hit || !t.startsolid ) + return; + } + VEC3 p1 = pos; defer( { if( !t.hit ) { -- cgit v1.2.3