prevent glider and sneak from triggering during trade

This commit is contained in:
ninefox 2022-03-07 20:28:38 -08:00
parent 61913402a2
commit 115b2875b3
2 changed files with 6 additions and 2 deletions

View File

@ -1116,6 +1116,8 @@ impl Client {
&self.pending_trade
}
pub fn is_trading(&self) -> bool { self.pending_trade.is_some() }
pub fn send_invite(&mut self, invitee: Uid, kind: InviteKind) {
self.send_msg(ClientGeneral::ControlEvent(ControlEvent::InitiateInvite(
invitee, kind,

View File

@ -599,7 +599,8 @@ impl PlayState for SessionState {
}
},
GameInput::Sneak => {
if state {
let is_trading = self.client.borrow().is_trading();
if state && !is_trading {
self.stop_auto_walk();
self.client.borrow_mut().toggle_sneak();
}
@ -629,7 +630,8 @@ impl PlayState for SessionState {
self.key_state.right = state
},
GameInput::Glide => {
if state {
let is_trading = self.client.borrow().is_trading();
if state && !is_trading {
if global_state.settings.gameplay.stop_auto_walk_on_input {
self.stop_auto_walk();
}