From 19b85afe12effe485e89ce17b1e3a9c77b635d3a Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 9 Jul 2014 02:56:09 -0400 Subject: [PATCH] Allow gtp with implicit current height when z is not provided. --- indra/newview/chatbar_as_cmdline.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 5a3fab318..3356f3c7a 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -258,17 +258,16 @@ bool cmd_line_chat(std::string revised_text, EChatType type) { if (i >> y) { - if (i >> z) + if (!(i >> z)) + z = gAgent.getPositionAgent().mV[VZ]; + + if (LLViewerRegion* agentRegionp = gAgent.getRegion()) { - LLViewerRegion* agentRegionp = gAgent.getRegion(); - if(agentRegionp) - { - LLVector3 targetPos(x,y,z); - LLVector3d pos_global = from_region_handle(agentRegionp->getHandle()); - pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]); - gAgent.teleportViaLocation(pos_global); - return false; - } + LLVector3 targetPos(x,y,z); + LLVector3d pos_global = from_region_handle(agentRegionp->getHandle()); + pos_global += LLVector3d((F64)targetPos.mV[0],(F64)targetPos.mV[1],(F64)targetPos.mV[2]); + gAgent.teleportViaLocation(pos_global); + return false; } } }