summaryrefslogtreecommitdiff
path: root/src/sector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sector.c')
-rw-r--r--src/sector.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sector.c b/src/sector.c
index f43ab86..2f1a7fe 100644
--- a/src/sector.c
+++ b/src/sector.c
@@ -175,7 +175,7 @@ void map_detect_collision(map_t *map)
// slide along the wall
if(sect->neighbors[i] == (size_t)-1
|| hole_high < player->pos.z + player->head_margin
- || hole_low - player->pos.z > player->knee_height) {
+ || hole_low - (player->pos.z - eyeheight ) > player->knee_height) {
// formula from wikipedia
float xd = vert(s1).x - vert(s0).x, yd = vert(s1).y - vert(s0).y;
player->velocity.x = xd * (dx*xd + yd*dy) / (xd*xd + yd*yd);