diff options
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1501ba41c2..7b9331e822 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3189,6 +3189,7 @@ void send_agent_update(bool force_send, bool send_reliable)      static F64          last_send_time = 0.0;      static U32          last_control_flags = 0; +    static bool         control_flags_follow_up = false;      static U8           last_render_state = 0;      static U8           last_flags = AU_FLAGS_NONE;      static LLQuaternion last_body_rot, @@ -3266,6 +3267,20 @@ void send_agent_update(bool force_send, bool send_reliable)                  break;              } +            // example: +            // user taps crouch (control_flags 4128), viewer sends 4128 then immediately 0 +            // server starts crouching motion but does not stop it, only once viewer sends 0 +            // second time will server stop the motion. follow_up exists to make sure all +            // states like 'crouch' motion are properly cleared server side. +            // +            // P.S. Server probably shouldn't require a reminder to stop a motion, +            // but at the moment it does. +            if (control_flags_follow_up) +            { +                send_update = true; +                break; +            } +              // check translation              constexpr F32 TRANSLATE_THRESHOLD = 0.01f;              if ((last_camera_pos_agent - camera_pos_agent).magVec() > TRANSLATE_THRESHOLD) @@ -3399,6 +3414,7 @@ void send_agent_update(bool force_send, bool send_reliable)      // remember last update data      last_send_time = now; +    control_flags_follow_up = last_control_flags != control_flags;      last_control_flags = control_flags;      last_render_state = render_state;      last_flags = flags;  | 
