Merge branch 'unvariant/trading_fix' into 'master'

prevent glider and sneak from triggering during trade

See merge request veloren/veloren!3264
This commit is contained in:
Marcel 2022-03-08 10:25:16 +00:00
commit d05cb99007
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();
}