Fix code to check for no spawn points. Possibly a merge artefact?

user_profiles
Melanie 2013-02-10 20:00:39 +00:00
parent 38b476d9d6
commit 6f3dcf58b8
1 changed files with 4 additions and 2 deletions

View File

@ -4046,6 +4046,8 @@ namespace OpenSim.Region.Framework.Scenes
{ {
case "random": case "random":
if (spawnPoints.Length == 0)
return;
do do
{ {
index = Util.RandomClass.Next(spawnPoints.Length - 1); index = Util.RandomClass.Next(spawnPoints.Length - 1);
@ -4057,8 +4059,8 @@ namespace OpenSim.Region.Framework.Scenes
// SpawnPoint sp = spawnPoints[index]; // SpawnPoint sp = spawnPoints[index];
ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y); ILandObject land = m_scene.LandChannel.GetLandObject(spawnPosition.X, spawnPosition.Y);
if (spawnPoints.Length == 0)
return; if (land == null || land.IsEitherBannedOrRestricted(UUID)) if (land == null || land.IsEitherBannedOrRestricted(UUID))
selected = false; selected = false;
else else
selected = true; selected = true;