From e8dc5e27ce00ad911bf04b4aef4bbcf6190930b9 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 3 Aug 2021 20:18:30 +0300 Subject: SL-15746 Turning right has priority over turning left Does not cover other opposite-direction movements since only rotation is viewer handled. --- indra/newview/llagent.cpp | 6 ++++++ indra/newview/llviewermessage.cpp | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 389448654a..41578f2328 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -713,6 +713,12 @@ void LLAgent::moveYaw(F32 mag, bool reset_view) setControlFlags(AGENT_CONTROL_YAW_NEG); } + U32 mask = AGENT_CONTROL_YAW_POS | AGENT_CONTROL_YAW_NEG; + if ((getControlFlags() & mask) == mask) + { + gAgentCamera.setYawKey(0); + } + if (reset_view) { gAgentCamera.resetView(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 39c891c9c1..9c6c0d03db 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3333,6 +3333,13 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // trigger a control event. U32 control_flags = gAgent.getControlFlags(); + // Rotation into both directions should cancel out + U32 mask = AGENT_CONTROL_YAW_POS | AGENT_CONTROL_YAW_NEG; + if ((control_flags & mask) == mask) + { + control_flags &= ~mask; + } + MASK key_mask = gKeyboard->currentMask(TRUE); if (key_mask & MASK_ALT || key_mask & MASK_CONTROL) -- cgit v1.2.3