summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolgun.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolgun.cpp')
-rw-r--r--indra/newview/lltoolgun.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp
index b70cff3869..8accf6babf 100644
--- a/indra/newview/lltoolgun.cpp
+++ b/indra/newview/lltoolgun.cpp
@@ -52,7 +52,8 @@
#include "llwindow.h" // setMouseClipping()
LLToolGun::LLToolGun( LLToolComposite* composite )
-: LLTool( std::string("gun"), composite )
+: LLTool( std::string("gun"), composite ),
+ mIsSelected(FALSE)
{
}
@@ -61,6 +62,7 @@ void LLToolGun::handleSelect()
gViewerWindow->hideCursor();
gViewerWindow->moveCursorToCenter();
gViewerWindow->mWindow->setMouseClipping(TRUE);
+ mIsSelected = TRUE;
}
void LLToolGun::handleDeselect()
@@ -68,6 +70,7 @@ void LLToolGun::handleDeselect()
gViewerWindow->moveCursorToCenter();
gViewerWindow->showCursor();
gViewerWindow->mWindow->setMouseClipping(FALSE);
+ mIsSelected = FALSE;
}
BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -80,7 +83,7 @@ BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask)
{
- if( gAgent.cameraMouselook() )
+ if( gAgent.cameraMouselook() && mIsSelected )
{
const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f;