From 8247c136bc44fdbae232afc26f60f08918656aff Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 13 Mar 2021 20:05:02 +0000 Subject: [PATCH] Prevented jumping airships --- common/src/states/utils.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index fda66fb758..3a82acb977 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -181,6 +181,13 @@ impl Body { } } + pub fn can_jump(&self) -> bool { + match self { + Body::Object(_) | Body::Ship(_) => false, + _ => true, + } + } + pub fn can_climb(&self) -> bool { matches!(self, Body::Humanoid(_)) } } @@ -435,6 +442,7 @@ pub fn handle_jump(data: &JoinData, update: &mut StateUpdate) { .in_liquid .map(|depth| depth > 1.0) .unwrap_or(false) + && data.body.can_jump() { update .local_events