Allow gtp with implicit current height when z is not provided.

This commit is contained in:
Lirusaito
2014-07-09 02:56:09 -04:00
parent b2e8a31d68
commit 19b85afe12

View File

@@ -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;
}
}
}