summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerjoystick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerjoystick.cpp')
-rw-r--r--indra/newview/llviewerjoystick.cpp39
1 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index 3a3f0b3d95..e5a8226720 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -413,10 +413,10 @@ void LLViewerJoystick::init(bool autoenable)
{
LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL;
// Failed to gather devices, init first suitable one
- mLastDeviceUUID = LLSD();
- void *preffered_device = NULL;
- initDevice(preffered_device);
- }
+ mLastDeviceUUID = LLSD();
+ void *preffered_device = NULL;
+ initDevice(preffered_device);
+ }
}
if (mDriverState == JDS_INITIALIZING)
@@ -510,10 +510,10 @@ void LLViewerJoystick::initDevice(LLSD &guid)
{
LL_INFOS("Joystick") << "Failed to gather input devices. Falling back to ndof's init" << LL_ENDL;
// Failed to gather devices from window, init first suitable one
- void *preffered_device = NULL;
- mLastDeviceUUID = LLSD();
- initDevice(preffered_device);
- }
+ void *preffered_device = NULL;
+ mLastDeviceUUID = LLSD();
+ initDevice(preffered_device);
+ }
}
if (mDriverState == JDS_INITIALIZING)
@@ -881,6 +881,10 @@ void LLViewerJoystick::moveObjects(bool reset)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
if (sDelta[0] || sDelta[1] || sDelta[2])
{
@@ -1055,6 +1059,10 @@ void LLViewerJoystick::moveAvatar(bool reset)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
setCameraNeedsUpdate(true);
}
@@ -1267,9 +1275,16 @@ void LLViewerJoystick::moveFlycam(bool reset)
}
// Clear AFK state if moved beyond the deadzone
- if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
+ if (!is_zero)
{
- gAgent.clearAFK();
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
+ {
+ gAgent.clearAFK();
+ }
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
}
sFlycamPosition += LLVector3(sDelta) * sFlycamRotation;
@@ -1331,6 +1346,10 @@ bool LLViewerJoystick::toggleFlycam()
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
mOverrideCamera = !mOverrideCamera;
if (mOverrideCamera)