diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/player.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/game/player.cpp b/src/game/player.cpp index 26c03af..c4b9c9a 100644 --- a/src/game/player.cpp +++ b/src/game/player.cpp @@ -147,6 +147,15 @@ void player_move( GAME_DATA* game, PLAYER* p ) { p->pos += wishmove; else { p->pos += wishmove * tr.frac; + + + // TODO: clipvelocity fixes this, clips velocity to 1 wall (should do 4) + VEC3 left = wishmove * (1.f - tr.frac); + F32 into = vec_dot( left, tr.normal ); + if( into < 0.f ) + left -= tr.normal * into; + + p->pos += left; } } } |
