summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llurldispatcher.cpp9
-rw-r--r--indra/newview/scripts/lua/require/LLAgent.lua3
2 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp
index 39a9f0f8bc..166542324d 100644
--- a/indra/newview/llurldispatcher.cpp
+++ b/indra/newview/llurldispatcher.cpp
@@ -289,6 +289,8 @@ public:
LLEventAPI::add("teleport",
"Teleport to specified [\"regionname\"] at\n"
"specified region-relative [\"x\"], [\"y\"], [\"z\"].\n"
+ "If [\"regionname\"] is \"home\", ignore [\"x\"], [\"y\"], [\"z\"]\n"
+ "and teleport home.\n"
"If [\"regionname\"] omitted, teleport to GLOBAL\n"
"coordinates [\"x\"], [\"y\"], [\"z\"].",
&LLTeleportHandler::from_event);
@@ -328,7 +330,12 @@ public:
void from_event(const LLSD& params) const
{
Response response(LLSD(), params);
- if (params.has("regionname"))
+ if (params["regionname"].asString() == "home")
+ {
+ gAgent.teleportHome();
+ response["message"] = "Teleporting home";
+ }
+ else if (params.has("regionname"))
{
// region specified, coordinates (if any) are region-local
LLVector3 local_pos(
diff --git a/indra/newview/scripts/lua/require/LLAgent.lua b/indra/newview/scripts/lua/require/LLAgent.lua
index 9eebede59f..5cee998fcd 100644
--- a/indra/newview/scripts/lua/require/LLAgent.lua
+++ b/indra/newview/scripts/lua/require/LLAgent.lua
@@ -72,11 +72,12 @@ function LLAgent.getAnimationInfo(item_id)
end
-- Teleport to specified "regionname" at specified region-relative "x", "y", "z".
+-- If "regionname" is "home", ignore "x", "y", "z" and teleport home.
-- If "regionname" omitted, teleport to GLOBAL coordinates "x", "y", "z".
function LLAgent.teleport(...)
local args = mapargs('regionname,x,y,z', ...)
args.op = 'teleport'
- return leap.request('LLTeleportHandler', args)
+ return leap.request('LLTeleportHandler', args).message
end
return LLAgent