OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.DoLLTeleport C# (CSharp) Method

DoLLTeleport() private method

private DoLLTeleport ( ScenePresence sp, string destination, System.Vector3 targetPos, System.Vector3 targetLookAt ) : void
sp OpenSim.Region.Framework.Scenes.ScenePresence
destination string
targetPos System.Vector3
targetLookAt System.Vector3
return void
        private void DoLLTeleport(ScenePresence sp, string destination, Vector3 targetPos, Vector3 targetLookAt)
        {
            UUID assetID = ScriptUtils.GetAssetIdFromKeyOrItemName(m_host, destination);

            // The destinaion is not an asset ID and also doesn't name a landmark.
            // Use it as a sim name
            if (assetID == UUID.Zero)
            {
                World.RequestTeleportLocation(sp.ControllingClient, destination, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
                return;
            }

            AssetBase lma = World.AssetService.Get(assetID.ToString());
            if (lma == null)
                return;

            if (lma.Type != (sbyte)AssetType.Landmark)
                return;

            AssetLandmark lm = new AssetLandmark(lma);

            World.RequestTeleportLocation(sp.ControllingClient, lm.RegionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
        }
LSL_Api