From 0be4ed3df42d4cd566110b30d84780e85f848c92 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 6 Mar 2012 22:27:01 +0100 Subject: Prevent scripted region crossings from crashing with prim limits enabled --- .../Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs') diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index c1957e2..59ff9b8 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -121,12 +121,18 @@ namespace OpenSim.Region.OptionalModules private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) { + if ((newPoint.X > 257f || newPoint.X < -1f || newPoint.Y > 257f || newPoint.Y < -1f)) + return true; + SceneObjectPart obj = scene.GetSceneObjectPart(objectID); Vector3 oldPoint = obj.GroupPosition; int objectCount = obj.ParentGroup.PrimCount; ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); + if (newParcel == null) + return true; + int usedPrims = newParcel.PrimCounts.Total; int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); @@ -171,4 +177,4 @@ namespace OpenSim.Region.OptionalModules return true; } } -} \ No newline at end of file +} -- cgit v1.1