Fix falling too fast with block above player

This commit is contained in:
xtreme8000 2023-11-20 19:53:47 +01:00
parent 2c3c59703a
commit fab3b9a343

View file

@ -150,8 +150,9 @@ static bool entity_tick(struct entity* e) {
new_vel[1] = -0.6F;
entity_try_move(e, new_pos, new_vel, &bbox, 1, &collision, &ground);
if(glm_vec3_distance2(e->pos_old, e->pos)
< glm_vec3_distance2(e->pos_old, new_pos)) {
if(new_pos[1] > e->pos_old[1]
&& glm_vec3_distance2(e->pos_old, e->pos)
< glm_vec3_distance2(e->pos_old, new_pos)) {
collision_xz = collision;
e->on_ground = ground;
glm_vec3_copy(new_pos, e->pos);