diff options
| author | navewindre <boneyaard@gmail.com> | 2025-10-02 06:26:57 +0200 |
|---|---|---|
| committer | navewindre <boneyaard@gmail.com> | 2025-10-02 06:26:57 +0200 |
| commit | 8f978c8bc5b9ab17316cdc01caaee9b9d62d683e (patch) | |
| tree | 7831f96017b3b394b3ddcdddcf49647ac5991f86 /src | |
| parent | db702f3197fadf8529789303a472f503100c715c (diff) | |
fix2
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; } } } |
