summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolpie.cpp
diff options
context:
space:
mode:
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 f8bf647670..d992d808c7 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -620,6 +620,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;
}