From 0ed4f24b3432d282f2f1517d403341cde069af29 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 5 Mar 2012 02:14:27 +0100 Subject: A stab at making llEjectFromLand work in all cases --- OpenSim/Region/Framework/Scenes/Scene.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 11a41aa..5d27d86 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4938,9 +4938,16 @@ Environment.Exit(1); return nearestPoint.Value; } - //Ultimate backup if we have no idea where they are - Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); - return avatar.lastKnownAllowedPosition; + ILandObject dest = LandChannel.GetLandObject(avatar.lastKnownAllowedPosition.X, avatar.lastKnownAllowedPosition.Y); + if (dest != excludeParcel) + { + // Ultimate backup if we have no idea where they are and + // the last allowed position was in another parcel + Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); + return avatar.lastKnownAllowedPosition; + } + + // else fall through to region edge } //Go to the edge, this happens in teleporting to a region with no available parcels -- cgit v1.1 From c2a73a26b550c523ed0f87c45caa7382bfc16667 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 5 Mar 2012 02:37:51 +0100 Subject: SL compatibility - return only points on segemtn, not ray in llCastRay --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5c02d98..fc6bec1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -11574,6 +11574,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 rayEnd = new Vector3((float)end.x, (float)end.y, (float)end.z); Vector3 dir = rayEnd - rayStart; + float dist = Vector3.Mag(dir); + int count = 1; bool detectPhantom = false; int dataFlags = 0; @@ -11630,6 +11632,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api int values = 0; foreach (ContactResult result in results) { + if (result.Depth > dist) + continue; + UUID itemID = UUID.Zero; int linkNum = 0; -- cgit v1.1