diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 584ffea8f1..2b58795656 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2440,6 +2440,14 @@ namespace OpenSim.Region.Framework.Scenes else group.StopScriptInstances(); + List avatars = group.GetSittingAvatars(); + foreach (UUID av in avatars) + { + ScenePresence p = GetScenePresence(av); + if (p != null) + p.StandUp(); + } + SceneObjectPart[] partList = group.Parts; foreach (SceneObjectPart part in partList) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6bcb361d17..5ea14c742d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4641,20 +4641,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(agentId); if (presence != null && presence.PresenceType != PresenceType.Npc) { - // agent must not be a god - if (presence.GodLevel >= 200) return; - if (destination == String.Empty) destination = World.RegionInfo.RegionName; - // agent must be over the owners land - if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) + if (m_item.PermsGranter == agentId) + { + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) + { + DoLLTeleport(presence, destination, targetPos, targetLookAt); + } + } + + // agent must be wearing the object + if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) { DoLLTeleport(presence, destination, targetPos, targetLookAt); } - else // or must be wearing the prim + else { - if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) + // agent must not be a god + if (presence.GodLevel >= 200) return; + + // agent must be over the owners land + ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition); + ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition); + if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID) { DoLLTeleport(presence, destination, targetPos, targetLookAt); } @@ -4668,24 +4679,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); UUID agentId = new UUID(); - ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); + ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256); if (UUID.TryParse(agent, out agentId)) { + // This function is owner only! + if (m_host.OwnerID != agentId) + return; + ScenePresence presence = World.GetScenePresence(agentId); + + // Can't TP sitting avatars + if (presence.ParentID != 0) // Sitting + return; + if (presence != null && presence.PresenceType != PresenceType.Npc) { - // agent must not be a god - if (presence.GodLevel >= 200) return; + if (m_item.PermsGranter == agentId) + { + // If attached using llAttachToAvatarTemp, cowardly refuse + if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero) + return; - // agent must be over the owners land - if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) - { - World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); - } - else // or must be wearing the prim - { - if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) + if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) { World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index c664a84428..6efa73f5e1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs @@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public const int PERMISSION_CHANGE_PERMISSIONS = 512; public const int PERMISSION_TRACK_CAMERA = 1024; public const int PERMISSION_CONTROL_CAMERA = 2048; + public const int PERMISSION_TELEPORT = 4096; public const int AGENT_FLYING = 1; public const int AGENT_ATTACHMENTS = 2; diff --git a/bin/HttpServer_OpenSim.dll b/bin/HttpServer_OpenSim.dll index e15493d338..38a4cb795c 100755 Binary files a/bin/HttpServer_OpenSim.dll and b/bin/HttpServer_OpenSim.dll differ