aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs57
1 files changed, 28 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index bdcef71..0d5c218 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3939,35 +3939,6 @@ namespace OpenSim.Region.Framework.Scenes
3939 3939
3940 switch (m_scene.SpawnPointRouting) 3940 switch (m_scene.SpawnPointRouting)
3941 { 3941 {
3942 case "closest":
3943
3944 float distance = 9999;
3945 int closest = -1;
3946
3947 for (int i = 0; i < spawnPoints.Length; i++)
3948 {
3949 Vector3 spawnPosition = spawnPoints[i].GetLocation(
3950 telehub.AbsolutePosition,
3951 telehub.GroupRotation
3952 );
3953 Vector3 offset = spawnPosition - pos;
3954 float d = Vector3.Mag(offset);
3955 if (d >= distance)
3956 continue;
3957 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
3958 if (land == null)
3959 continue;
3960 if (land.IsEitherBannedOrRestricted(UUID))
3961 continue;
3962 distance = d;
3963 closest = i;
3964 }
3965 if (closest == -1)
3966 return;
3967
3968 pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
3969 return;
3970
3971 case "random": 3942 case "random":
3972 3943
3973 do 3944 do
@@ -4019,7 +3990,35 @@ namespace OpenSim.Region.Framework.Scenes
4019 return; 3990 return;
4020 3991
4021 default: 3992 default:
3993 case "closest":
3994
3995 float distance = 9999;
3996 int closest = -1;
3997
3998 for (int i = 0; i < spawnPoints.Length; i++)
3999 {
4000 Vector3 spawnPosition = spawnPoints[i].GetLocation(
4001 telehub.AbsolutePosition,
4002 telehub.GroupRotation
4003 );
4004 Vector3 offset = spawnPosition - pos;
4005 float d = Vector3.Mag(offset);
4006 if (d >= distance)
4007 continue;
4008 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
4009 if (land == null)
4010 continue;
4011 if (land.IsEitherBannedOrRestricted(UUID))
4012 continue;
4013 distance = d;
4014 closest = i;
4015 }
4016 if (closest == -1)
4017 return;
4018
4019 pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
4022 return; 4020 return;
4021
4023 } 4022 }
4024 } 4023 }
4025 } 4024 }