From d18483756b12a99839af6d14fdbff515d831cca1 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 22 May 2022 19:37:52 +0100 Subject: [PATCH] Fixed frozen character when wall-run into water horizontally --- common/src/states/wallrun.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/src/states/wallrun.rs b/common/src/states/wallrun.rs index 4b802f1cbe..a7a7594a3a 100644 --- a/common/src/states/wallrun.rs +++ b/common/src/states/wallrun.rs @@ -31,8 +31,13 @@ impl CharacterBehavior for Data { .max(0.2); } - // fall off wall or hit ground - if data.physics.on_wall.is_none() || data.physics.on_ground.is_some() { + // fall off wall, hit ground, or enter water + // TODO: Rugged way to determine when state change occurs and we need to leave + // this state + if data.physics.on_wall.is_none() + || data.physics.on_ground.is_some() + || data.physics.in_fluid.is_some() + { update.character = CharacterState::Idle(idle::Data { is_sneaking: false }); }