summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-09-20 09:56:57 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-09-20 09:56:57 +0100
commit301f0c6a3b28a3040f8cb36e73d3b367a9262724 (patch)
tree97c37b2db9701f01f9872b58a414990bbc311de4 /indra/newview/lltoolpie.cpp
parentc2a87df2bccbf6e662f3a4c4edb210748ffa692d (diff)
parentb92ca367aed209b6e8007035ea307d5a0c8d53dc (diff)
merge.
Diffstat (limited to 'indra/newview/lltoolpie.cpp')
-rw-r--r--indra/newview/lltoolpie.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index d8be70e546..864de018e0 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -619,6 +619,25 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)
return TRUE;
}
}
+ else if (gSavedSettings.getBOOL("DoubleClickTeleport"))
+ {
+ LLViewerObject* objp = mPick.getObject();
+ LLViewerObject* parentp = objp ? objp->getRootEdit() : NULL;
+
+ bool is_in_world = mPick.mObjectID.notNull() && objp && !objp->isHUDAttachment();
+ bool is_land = mPick.mPickType == LLPickInfo::PICK_LAND;
+ bool pos_non_zero = !mPick.mPosGlobal.isExactlyZero();
+ bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
+ bool has_click_action = final_click_action(objp);
+
+ if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
+ {
+ LLVector3d pos = mPick.mPosGlobal;
+ pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
+ gAgent.teleportViaLocationLookAt(pos);
+ return TRUE;
+ }
+ }
return FALSE;
}