Merge branch 'master' of /home/opensim/lib/osgrid/opensim

0.7.4.1
BlueWall 2012-05-17 00:49:33 -04:00
commit 2af11fea37
1 changed files with 28 additions and 29 deletions

View File

@ -3939,35 +3939,6 @@ namespace OpenSim.Region.Framework.Scenes
switch (m_scene.SpawnPointRouting)
{
case "closest":
float distance = 9999;
int closest = -1;
for (int i = 0; i < spawnPoints.Length; i++)
{
Vector3 spawnPosition = spawnPoints[i].GetLocation(
telehub.AbsolutePosition,
telehub.GroupRotation
);
Vector3 offset = spawnPosition - pos;
float d = Vector3.Mag(offset);
if (d >= distance)
continue;
ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
if (land == null)
continue;
if (land.IsEitherBannedOrRestricted(UUID))
continue;
distance = d;
closest = i;
}
if (closest == -1)
return;
pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
return;
case "random":
do
@ -4019,7 +3990,35 @@ namespace OpenSim.Region.Framework.Scenes
return;
default:
case "closest":
float distance = 9999;
int closest = -1;
for (int i = 0; i < spawnPoints.Length; i++)
{
Vector3 spawnPosition = spawnPoints[i].GetLocation(
telehub.AbsolutePosition,
telehub.GroupRotation
);
Vector3 offset = spawnPosition - pos;
float d = Vector3.Mag(offset);
if (d >= distance)
continue;
ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
if (land == null)
continue;
if (land.IsEitherBannedOrRestricted(UUID))
continue;
distance = d;
closest = i;
}
if (closest == -1)
return;
pos = spawnPoints[closest].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
return;
}
}
}