aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs103
1 files changed, 84 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b737f91..bdcef71 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3934,28 +3934,93 @@ namespace OpenSim.Region.Framework.Scenes
3934 if (spawnPoints.Length == 0) 3934 if (spawnPoints.Length == 0)
3935 return; 3935 return;
3936 3936
3937 float distance = 9999; 3937 int index;
3938 int closest = -1; 3938 bool selected = false;
3939 3939
3940 for (int i = 0 ; i < spawnPoints.Length ; i++) 3940 switch (m_scene.SpawnPointRouting)
3941 { 3941 {
3942 Vector3 spawnPosition = spawnPoints[i].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 3942 case "closest":
3943 Vector3 offset = spawnPosition - pos;
3944 float d = Vector3.Mag(offset);
3945 if (d >= distance)
3946 continue;
3947 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
3948 if (land == null)
3949 continue;
3950 if (land.IsEitherBannedOrRestricted(UUID))
3951 continue;
3952 distance = d;
3953 closest = i;
3954 }
3955 if (closest == -1)
3956 return;
3957 3943
3958 pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation); 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":
3972
3973 do
3974 {
3975 index = Util.RandomClass.Next(spawnPoints.Length - 1);
3976
3977 Vector3 spawnPosition = spawnPoints[index].GetLocation(
3978 telehub.AbsolutePosition,
3979 telehub.GroupRotation
3980 );
3981 // SpawnPoint sp = spawnPoints[index];
3982
3983 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
3984 if (land == null || land.IsEitherBannedOrRestricted(UUID))
3985 selected = false;
3986 else
3987 selected = true;
3988
3989 } while ( selected == false);
3990
3991 pos = spawnPoints[index].GetLocation(
3992 telehub.AbsolutePosition,
3993 telehub.GroupRotation
3994 );
3995 return;
3996
3997 case "sequence":
3998
3999 do
4000 {
4001 index = m_scene.SpawnPoint();
4002
4003 Vector3 spawnPosition = spawnPoints[index].GetLocation(
4004 telehub.AbsolutePosition,
4005 telehub.GroupRotation
4006 );
4007 // SpawnPoint sp = spawnPoints[index];
4008
4009 ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
4010 if (land == null || land.IsEitherBannedOrRestricted(UUID))
4011 selected = false;
4012 else
4013 selected = true;
4014
4015 } while (selected == false);
4016
4017 pos = spawnPoints[index].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
4018 ;
4019 return;
4020
4021 default:
4022 return;
4023 }
3959 } 4024 }
3960 } 4025 }
3961 } 4026 }