aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2012-03-06 00:29:43 +0000
committerMelanie2012-03-06 00:29:43 +0000
commitaa613dab1f5f9f0f3f9fa50f0307da0cb6620b33 (patch)
tree8c666a42b4a53374590e5302b5faddf97c5c033d /OpenSim
parentMerge branch 'master' into careminster (diff)
parentAllow NPC to be removed by the owner of the parcel they're over. (diff)
downloadopensim-SC-aa613dab1f5f9f0f3f9fa50f0307da0cb6620b33.zip
opensim-SC-aa613dab1f5f9f0f3f9fa50f0307da0cb6620b33.tar.gz
opensim-SC-aa613dab1f5f9f0f3f9fa50f0307da0cb6620b33.tar.bz2
opensim-SC-aa613dab1f5f9f0f3f9fa50f0307da0cb6620b33.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs7
4 files changed, 42 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index e675c73..4fc59e2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4923,9 +4923,16 @@ Environment.Exit(1);
4923 return nearestPoint.Value; 4923 return nearestPoint.Value;
4924 } 4924 }
4925 4925
4926 //Ultimate backup if we have no idea where they are 4926 ILandObject dest = LandChannel.GetLandObject(avatar.lastKnownAllowedPosition.X, avatar.lastKnownAllowedPosition.Y);
4927 Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); 4927 if (dest != excludeParcel)
4928 return avatar.lastKnownAllowedPosition; 4928 {
4929 // Ultimate backup if we have no idea where they are and
4930 // the last allowed position was in another parcel
4931 Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString());
4932 return avatar.lastKnownAllowedPosition;
4933 }
4934
4935 // else fall through to region edge
4929 } 4936 }
4930 4937
4931 //Go to the edge, this happens in teleporting to a region with no available parcels 4938 //Go to the edge, this happens in teleporting to a region with no available parcels
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 4366626..6d4072c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4641,7 +4641,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4641 if (UUID.TryParse(agent, out agentId)) 4641 if (UUID.TryParse(agent, out agentId))
4642 { 4642 {
4643 ScenePresence presence = World.GetScenePresence(agentId); 4643 ScenePresence presence = World.GetScenePresence(agentId);
4644 if (presence != null) 4644 if (presence != null && presence.PresenceType != PresenceType.Npc)
4645 { 4645 {
4646 // agent must not be a god 4646 // agent must not be a god
4647 if (presence.UserLevel >= 200) return; 4647 if (presence.UserLevel >= 200) return;
@@ -4650,7 +4650,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4650 if (m_host.OwnerID == World.LandChannel.GetLandObject( 4650 if (m_host.OwnerID == World.LandChannel.GetLandObject(
4651 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 4651 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
4652 { 4652 {
4653 World.TeleportClientHome(agentId, presence.ControllingClient); 4653 if (!World.TeleportClientHome(agentId, presence.ControllingClient))
4654 {
4655 // They can't be teleported home for some reason
4656 GridRegion regionInfo = World.GridService.GetRegionByUUID(UUID.Zero, new UUID("2b02daac-e298-42fa-9a75-f488d37896e6"));
4657 if (regionInfo != null)
4658 {
4659 World.RequestTeleportLocation(
4660 presence.ControllingClient, regionInfo.RegionHandle, new Vector3(128, 128, 23), Vector3.Zero,
4661 (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
4662 }
4663 }
4654 } 4664 }
4655 } 4665 }
4656 } 4666 }
@@ -4664,7 +4674,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4664 if (UUID.TryParse(agent, out agentId)) 4674 if (UUID.TryParse(agent, out agentId))
4665 { 4675 {
4666 ScenePresence presence = World.GetScenePresence(agentId); 4676 ScenePresence presence = World.GetScenePresence(agentId);
4667 if (presence != null) 4677 if (presence != null && presence.PresenceType != PresenceType.Npc)
4668 { 4678 {
4669 // agent must not be a god 4679 // agent must not be a god
4670 if (presence.UserLevel >= 200) return; 4680 if (presence.UserLevel >= 200) return;
@@ -11658,6 +11668,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11658 Vector3 rayEnd = new Vector3((float)end.x, (float)end.y, (float)end.z); 11668 Vector3 rayEnd = new Vector3((float)end.x, (float)end.y, (float)end.z);
11659 Vector3 dir = rayEnd - rayStart; 11669 Vector3 dir = rayEnd - rayStart;
11660 11670
11671 float dist = Vector3.Mag(dir);
11672
11661 int count = 1; 11673 int count = 1;
11662 bool detectPhantom = false; 11674 bool detectPhantom = false;
11663 int dataFlags = 0; 11675 int dataFlags = 0;
@@ -11714,6 +11726,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11714 int values = 0; 11726 int values = 0;
11715 foreach (ContactResult result in results) 11727 foreach (ContactResult result in results)
11716 { 11728 {
11729 if (result.Depth > dist)
11730 continue;
11731
11717 UUID itemID = UUID.Zero; 11732 UUID itemID = UUID.Zero;
11718 int linkNum = 0; 11733 int linkNum = 0;
11719 11734
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 44fd980..ecc5fb5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2290,6 +2290,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2290 2290
2291 string groupTitle = String.Empty; 2291 string groupTitle = String.Empty;
2292 2292
2293 if (!World.Permissions.CanRezObject(1, m_host.OwnerID, new Vector3((float)position.x, (float)position.y, (float)position.z)))
2294 return new LSL_Key(UUID.Zero.ToString());
2295
2293 if (firstname != String.Empty || lastname != String.Empty) 2296 if (firstname != String.Empty || lastname != String.Empty)
2294 { 2297 {
2295 if (firstname != "Shown outfit:") 2298 if (firstname != "Shown outfit:")
@@ -2619,8 +2622,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2619 { 2622 {
2620 UUID npcId = new UUID(npc.m_string); 2623 UUID npcId = new UUID(npc.m_string);
2621 2624
2622 if (!module.CheckPermissions(npcId, m_host.OwnerID)) 2625 ILandObject l = World.LandChannel.GetLandObject(m_host.GroupPosition.X, m_host.GroupPosition.Y);
2623 return; 2626 if (l == null || m_host.OwnerID != l.LandData.OwnerID)
2627 {
2628 if (!module.CheckPermissions(npcId, m_host.OwnerID))
2629 return;
2630 }
2624 2631
2625 module.DeleteNPC(npcId, World); 2632 module.DeleteNPC(npcId, World);
2626 } 2633 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
index 9e6752c..8adf4c5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs
@@ -858,7 +858,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
858 ret = Math.Sign(Quaternion.Mag(l) - Quaternion.Mag(r)); 858 ret = Math.Sign(Quaternion.Mag(l) - Quaternion.Mag(r));
859 } 859 }
860 860
861 if (ascending == 0) 861 if (ascending != 1)
862 { 862 {
863 ret = 0 - ret; 863 ret = 0 - ret;
864 } 864 }
@@ -891,6 +891,9 @@ namespace OpenSim.Region.ScriptEngine.Shared
891 stride = 1; 891 stride = 1;
892 } 892 }
893 893
894 if ((Data.Length % stride) != 0)
895 return new list(ret);
896
894 // we can optimize here in the case where stride == 1 and the list 897 // we can optimize here in the case where stride == 1 and the list
895 // consists of homogeneous types 898 // consists of homogeneous types
896 899
@@ -910,7 +913,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
910 if (homogeneous) 913 if (homogeneous)
911 { 914 {
912 Array.Sort(ret, new HomogeneousComparer()); 915 Array.Sort(ret, new HomogeneousComparer());
913 if (ascending == 0) 916 if (ascending != 1)
914 { 917 {
915 Array.Reverse(ret); 918 Array.Reverse(ret);
916 } 919 }