diff options
author | Melanie | 2012-02-02 16:51:39 +0100 |
---|---|---|
committer | Melanie | 2012-02-02 16:51:39 +0100 |
commit | fd7e82ee7237617a8e19b1eede3cf5164a587a67 (patch) | |
tree | e8d276c26bab115b819e82140e893d4d9fc754d4 /OpenSim/Region/Framework/Scenes | |
parent | Rehook the eject and freeze events that had gotten unhooked in the merge (diff) | |
download | opensim-SC-fd7e82ee7237617a8e19b1eede3cf5164a587a67.zip opensim-SC-fd7e82ee7237617a8e19b1eede3cf5164a587a67.tar.gz opensim-SC-fd7e82ee7237617a8e19b1eede3cf5164a587a67.tar.bz2 opensim-SC-fd7e82ee7237617a8e19b1eede3cf5164a587a67.tar.xz |
Streamline banning code using existing methods.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 16 |
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) |