From 46bd7b191622b36f85ca09259b56447d00650b5b Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Sat, 2 Oct 2021 22:29:54 -0400 Subject: [PATCH] Fixed gravity bug --- game/src/character/collisions.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/game/src/character/collisions.rs b/game/src/character/collisions.rs index 6167c50..f2c632c 100644 --- a/game/src/character/collisions.rs +++ b/game/src/character/collisions.rs @@ -79,7 +79,10 @@ pub fn modify_player_based_on_forces( level_height_offset, ); } + }else if player.current_state == CharacterState::Running { + player.override_state(CharacterState::Jumping); } + // Finally apply the velocity to the player player.position += player.velocity; @@ -100,5 +103,6 @@ pub fn modify_player_based_on_forces( return Err(()); } + Ok(()) }