summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolgrab.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolgrab.cpp')
-rw-r--r--indra/newview/lltoolgrab.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp
index ed9ca851d3..d9811dac6c 100644
--- a/indra/newview/lltoolgrab.cpp
+++ b/indra/newview/lltoolgrab.cpp
@@ -210,22 +210,29 @@ BOOL LLToolGrab::handleObjectHit(const LLPickInfo& info)
if (!objectp->usePhysics())
{
- // In mouselook, we shouldn't be able to grab non-physical,
- // non-touchable objects. If it has a touch handler, we
- // do grab it (so llDetectedGrab works), but movement is
- // blocked on the server side. JC
- if (gAgent.cameraMouselook() && !script_touch)
+ if (script_touch)
{
- mMode = GRAB_LOCKED;
- gViewerWindow->hideCursor();
- gViewerWindow->moveCursorToCenter();
+ mMode = GRAB_NONPHYSICAL; // if it has a script, use the non-physical grab
}
else
{
- mMode = GRAB_NONPHYSICAL;
+ // In mouselook, we shouldn't be able to grab non-physical,
+ // non-touchable objects. If it has a touch handler, we
+ // do grab it (so llDetectedGrab works), but movement is
+ // blocked on the server side. JC
+ if (gAgent.cameraMouselook())
+ {
+ mMode = GRAB_LOCKED;
+ }
+ else
+ {
+ mMode = GRAB_ACTIVE_CENTER;
+ }
+
+ gViewerWindow->hideCursor();
+ gViewerWindow->moveCursorToCenter();
+
}
- // Don't bail out here, go on and grab so buttons can get
- // their "touched" event.
}
else if( !objectp->permMove() )
{