From a285ff7e6942f9b55b18b00a765a5b4491fba011 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Jan 2013 14:27:21 +0000 Subject: check land permitions on sit target for unscripted sits --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c16c544..5087882 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2247,6 +2247,17 @@ namespace OpenSim.Region.Framework.Scenes return false; } + + private bool CanEnterLandPosition(Vector3 testPos) + { + ILandObject land = m_scene.LandChannel.GetLandObject(testPos.X, testPos.Y); + + if (land == null || land.LandData.Name == "NO_LAND") + return true; + + return land.CanBeOnThisLand(UUID,testPos.Z); + } + // status // < 0 ignore // 0 bad sit spot @@ -2265,6 +2276,12 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; + Vector3 targetPos = part.GetWorldPosition() + offset * part.GetWorldRotation(); + if(!CanEnterLandPosition(targetPos)) + { + ControllingClient.SendAlertMessage(" Sit position on restricted land, try another spot"); + return; + } // m_log.InfoFormat("physsit {0} {1}", offset.ToString(),Orientation.ToString()); RemoveFromPhysicalScene(); -- cgit v1.1