From d79b0ba269bfb98de6296b7c0219f6eb2e575710 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 24 Aug 2007 12:34:00 +0000 Subject: Hopefully fixed mantis bug #318 (exception when a prim moves across a border, for now have stopped prims moving beyond a regions area, will add sending prims from one region to another soon). --- .../Environment/LandManagement/LandManager.cs | 6 ++++-- .../Region/Environment/Scenes/SceneObjectGroup.cs | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs index 1ed0642..2f345f4 100644 --- a/OpenSim/Region/Environment/LandManagement/LandManager.cs +++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs @@ -207,7 +207,8 @@ namespace OpenSim.Region.Environment.LandManagement if (x > 63 || y > 63 || x < 0 || y < 0) { - throw new Exception("Error: Parcel not found at point " + x + ", " + y); + return null; + //throw new Exception("Error: Parcel not found at point " + x + ", " + y); } else { @@ -220,7 +221,8 @@ namespace OpenSim.Region.Environment.LandManagement { if (x > 256 || y > 256 || x < 0 || y < 0) { - throw new Exception("Error: Parcel not found at point " + x + ", " + y); + return null; + //throw new Exception("Error: Parcel not found at point " + x + ", " + y); } else { diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index ba6f6ea..cbf92a8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -83,11 +83,30 @@ namespace OpenSim.Region.Environment.Scenes get { return m_rootPart.GroupPosition; } set { + LLVector3 val = value; + if (val.X > 255.6f) + { + val.X = 255.6f; + } + else if (val.X < 0.4f) + { + val.X = 0.4f; + } + + if (val.Y > 255.6f) + { + val.Y = 255.6f; + } + else if (val.Y < 0.4f) + { + val.Y = 0.4f; + } + lock (this.m_parts) { foreach (SceneObjectPart part in this.m_parts.Values) { - part.GroupPosition = value; + part.GroupPosition = val; } } if (m_rootPart.PhysActor != null) -- cgit v1.1