Skip to content
Snippets Groups Projects
Commit 6fe7dab0 authored by andreykproductengine's avatar andreykproductengine
Browse files

MAINT-4304 FIXED Avatar stuck running if releasing shift during double-tap strafe

parent 33178d57
No related branches found
No related tags found
No related merge requests found
......@@ -88,18 +88,25 @@ void agent_push_down( EKeystate s )
gAgent.moveUp(-1);
}
static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode)
{
if (gAgent.mDoubleTapRunMode == mode &&
gAgent.getRunning() &&
!gAgent.getAlwaysRun())
{
// Turn off temporary running.
gAgent.clearRunning();
gAgent.sendWalkRun(gAgent.getRunning());
}
}
static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode)
{
if (KEYSTATE_UP == s)
{
if (gAgent.mDoubleTapRunMode == mode &&
gAgent.getRunning() &&
!gAgent.getAlwaysRun())
{
// Turn off temporary running.
gAgent.clearRunning();
gAgent.sendWalkRun(gAgent.getRunning());
}
// Note: in case shift is already released, slide left/right run
// will be released in agent_turn_left()/agent_turn_right()
agent_check_temporary_run(mode);
}
else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") &&
KEYSTATE_DOWN == s &&
......@@ -218,7 +225,12 @@ void agent_turn_left( EKeystate s )
}
else
{
if (KEYSTATE_UP == s) return;
if (KEYSTATE_UP == s)
{
// Check temporary running. In case user released 'left' key with shift already released.
agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDELEFT);
return;
}
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( LLFloaterMove::getYawRate( time ) );
}
......@@ -241,7 +253,12 @@ void agent_turn_right( EKeystate s )
}
else
{
if (KEYSTATE_UP == s) return;
if (KEYSTATE_UP == s)
{
// Check temporary running. In case user released 'right' key with shift already released.
agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDERIGHT);
return;
}
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( -LLFloaterMove::getYawRate( time ) );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment