aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2013-06-02 23:53:20 +0200
committerMelanie2013-06-02 23:53:20 +0200
commit57c8d82c9e3d55581982a75a02d1f54bc547fb50 (patch)
tree7c12399b7b32a79eaa7db32dacc681c7f77b997d
parentUnsit seated avatars when an object is deleted (diff)
downloadopensim-SC-57c8d82c9e3d55581982a75a02d1f54bc547fb50.zip
opensim-SC-57c8d82c9e3d55581982a75a02d1f54bc547fb50.tar.gz
opensim-SC-57c8d82c9e3d55581982a75a02d1f54bc547fb50.tar.bz2
opensim-SC-57c8d82c9e3d55581982a75a02d1f54bc547fb50.tar.xz
Fix llTeleportAgentGlobalCoords
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs27
1 files changed, 16 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5af2a8d..5ea14c7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4679,24 +4679,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4679 m_host.AddScriptLPS(1); 4679 m_host.AddScriptLPS(1);
4680 UUID agentId = new UUID(); 4680 UUID agentId = new UUID();
4681 4681
4682 ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); 4682 ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256);
4683 4683
4684 if (UUID.TryParse(agent, out agentId)) 4684 if (UUID.TryParse(agent, out agentId))
4685 { 4685 {
4686 // This function is owner only!
4687 if (m_host.OwnerID != agentId)
4688 return;
4689
4686 ScenePresence presence = World.GetScenePresence(agentId); 4690 ScenePresence presence = World.GetScenePresence(agentId);
4691
4692 // Can't TP sitting avatars
4693 if (presence.ParentID != 0) // Sitting
4694 return;
4695
4687 if (presence != null && presence.PresenceType != PresenceType.Npc) 4696 if (presence != null && presence.PresenceType != PresenceType.Npc)
4688 { 4697 {
4689 // agent must not be a god 4698 if (m_item.PermsGranter == agentId)
4690 if (presence.GodLevel >= 200) return;
4691
4692 // agent must be over the owners land
4693 if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
4694 {
4695 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
4696 }
4697 else // or must be wearing the prim
4698 { 4699 {
4699 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) 4700 // If attached using llAttachToAvatarTemp, cowardly refuse
4701 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero)
4702 return;
4703
4704 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
4700 { 4705 {
4701 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); 4706 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
4702 } 4707 }