summaryrefslogtreecommitdiff
path: root/src/game/physics/movement.cpp
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-04 00:08:05 +0100
committeraura <nw@moneybot.cc>2026-03-04 00:08:05 +0100
commit333b457d30966fceb50fd420a559ae7d0aa3dad6 (patch)
tree3dd81979a101d6d53f19bc2d75ad721dbee51b2c /src/game/physics/movement.cpp
parent7466c0415415052cda55f02befb720d2a348b6c9 (diff)
minor fix
Diffstat (limited to 'src/game/physics/movement.cpp')
-rw-r--r--src/game/physics/movement.cpp14
1 files changed, 13 insertions, 1 deletions
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 ) {