From a443dcce8974a8ed197ad144599050f75e6aee25 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 3 Jul 2016 10:22:14 +0100 Subject: [PATCH] try to place avatars on a nicer location, when they arrive into a banned parcel --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a75b460cd2..5290abb8c7 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4309,14 +4309,14 @@ namespace OpenSim.Region.Framework.Scenes if (banned || restricted) { ILandObject nearestParcel = GetNearestAllowedParcel(agentID, posX, posY); + Vector2? newPosition = null; if (nearestParcel != null) { //Move agent to nearest allowed - Vector2 newPosition = GetParcelSafeCorner(nearestParcel); - posX = newPosition.X; - posY = newPosition.Y; +// Vector2 newPosition = GetParcelSafeCorner(nearestParcel); + newPosition = nearestParcel.GetNearestPoint(new Vector3(posX, posY,0)); } - else + if(newPosition == null) { if (banned) { @@ -4329,6 +4329,11 @@ namespace OpenSim.Region.Framework.Scenes } return false; } + else + { + posX = newPosition.Value.X; + posY = newPosition.Value.Y; + } } reason = ""; return true;