aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs16
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b37df82..128954f 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4855,9 +4855,14 @@ Environment.Exit(1);
4855 get { return m_allowScriptCrossings; } 4855 get { return m_allowScriptCrossings; }
4856 } 4856 }
4857 4857
4858 public Vector3? GetNearestAllowedPosition(ScenePresence avatar) 4858 public Vector3 GetNearestAllowedPosition(ScenePresence avatar)
4859 { 4859 {
4860 ILandObject nearestParcel = GetNearestAllowedParcel(avatar.UUID, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 4860 return GetNearestAllowedPosition(avatar, null);
4861 }
4862
4863 public Vector3 GetNearestAllowedPosition(ScenePresence avatar, ILandObject excludeParcel)
4864 {
4865 ILandObject nearestParcel = GetNearestAllowedParcel(avatar.UUID, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, excludeParcel);
4861 4866
4862 if (nearestParcel != null) 4867 if (nearestParcel != null)
4863 { 4868 {
@@ -4916,13 +4921,18 @@ Environment.Exit(1);
4916 4921
4917 public ILandObject GetNearestAllowedParcel(UUID avatarId, float x, float y) 4922 public ILandObject GetNearestAllowedParcel(UUID avatarId, float x, float y)
4918 { 4923 {
4924 return GetNearestAllowedParcel(avatarId, x, y, null);
4925 }
4926
4927 public ILandObject GetNearestAllowedParcel(UUID avatarId, float x, float y, ILandObject excludeParcel)
4928 {
4919 List<ILandObject> all = AllParcels(); 4929 List<ILandObject> all = AllParcels();
4920 float minParcelDistance = float.MaxValue; 4930 float minParcelDistance = float.MaxValue;
4921 ILandObject nearestParcel = null; 4931 ILandObject nearestParcel = null;
4922 4932
4923 foreach (var parcel in all) 4933 foreach (var parcel in all)
4924 { 4934 {
4925 if (!parcel.IsEitherBannedOrRestricted(avatarId)) 4935 if (!parcel.IsEitherBannedOrRestricted(avatarId) && parcel != excludeParcel)
4926 { 4936 {
4927 float parcelDistance = GetParcelDistancefromPoint(parcel, x, y); 4937 float parcelDistance = GetParcelDistancefromPoint(parcel, x, y);
4928 if (parcelDistance < minParcelDistance) 4938 if (parcelDistance < minParcelDistance)