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

0.7.4-extended
Melanie 2013-02-10 20:00:39 +00:00 committed by Justin Clark-Casey (justincc)
parent 2be88cd46c
commit 4fd176f479
1 changed files with 4 additions and 2 deletions

View File

@ -3905,6 +3905,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);
@ -3916,8 +3918,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;