From 3ae4115e4390eab1391b74ba82792dc5df9dac1e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 3 May 2019 00:39:55 +0100 Subject: osLocalTeleportAgent: if lookat or fly options, just move the avatar, not telling viewer about any teleport --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 61 +++++++++++++----------- 1 file changed, 33 insertions(+), 28 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b12bb45..f569d21 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1776,38 +1776,43 @@ namespace OpenSim.Region.Framework.Scenes if (newpos.Z < posZLimit) newpos.Z = posZLimit; - if ((flags & 8) != 0) - Flying = true; - else if ((flags & 16) != 0) - Flying = false; + if((flags & 0x1e) != 0) + { + if ((flags & 8) != 0) + Flying = true; + else if ((flags & 16) != 0) + Flying = false; - uint tpflags = (uint)TeleportFlags.ViaLocation; - if(Flying) - tpflags |= (uint)TeleportFlags.IsFlying; + uint tpflags = (uint)TeleportFlags.ViaLocation; + if(Flying) + tpflags |= (uint)TeleportFlags.IsFlying; - Vector3 lookat = Lookat; + Vector3 lookat = Lookat; - if ((flags & 2) != 0) - { - newlookat.Z = 0; - newlookat.Normalize(); - if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) - lookat = newlookat; - } - else if((flags & 4) != 0) - { - if((flags & 1) != 0) - newlookat = newvel; - else - newlookat = m_velocity; - newlookat.Z = 0; - newlookat.Normalize(); - if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) - lookat = newlookat; - } + if ((flags & 2) != 0) + { + newlookat.Z = 0; + newlookat.Normalize(); + if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) + lookat = newlookat; + } + else if((flags & 4) != 0) + { + if((flags & 1) != 0) + newlookat = newvel; + else + newlookat = m_velocity; + newlookat.Z = 0; + newlookat.Normalize(); + if (Math.Abs(newlookat.X) > 0.001 || Math.Abs(newlookat.Y) > 0.001) + lookat = newlookat; + } - AbsolutePosition = newpos; - ControllingClient.SendLocalTeleport(newpos, lookat, tpflags); + AbsolutePosition = newpos; + ControllingClient.SendLocalTeleport(newpos, lookat, tpflags); + } + else + AbsolutePosition = newpos; if ((flags & 1) != 0) { -- cgit v1.1