diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a75b460..5290abb 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -4309,14 +4309,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
4309 | if (banned || restricted) | 4309 | if (banned || restricted) |
4310 | { | 4310 | { |
4311 | ILandObject nearestParcel = GetNearestAllowedParcel(agentID, posX, posY); | 4311 | ILandObject nearestParcel = GetNearestAllowedParcel(agentID, posX, posY); |
4312 | Vector2? newPosition = null; | ||
4312 | if (nearestParcel != null) | 4313 | if (nearestParcel != null) |
4313 | { | 4314 | { |
4314 | //Move agent to nearest allowed | 4315 | //Move agent to nearest allowed |
4315 | Vector2 newPosition = GetParcelSafeCorner(nearestParcel); | 4316 | // Vector2 newPosition = GetParcelSafeCorner(nearestParcel); |
4316 | posX = newPosition.X; | 4317 | newPosition = nearestParcel.GetNearestPoint(new Vector3(posX, posY,0)); |
4317 | posY = newPosition.Y; | ||
4318 | } | 4318 | } |
4319 | else | 4319 | if(newPosition == null) |
4320 | { | 4320 | { |
4321 | if (banned) | 4321 | if (banned) |
4322 | { | 4322 | { |
@@ -4329,6 +4329,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
4329 | } | 4329 | } |
4330 | return false; | 4330 | return false; |
4331 | } | 4331 | } |
4332 | else | ||
4333 | { | ||
4334 | posX = newPosition.Value.X; | ||
4335 | posY = newPosition.Value.Y; | ||
4336 | } | ||
4332 | } | 4337 | } |
4333 | reason = ""; | 4338 | reason = ""; |
4334 | return true; | 4339 | return true; |