aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs38
1 files changed, 25 insertions, 13 deletions
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index a6d43f1..a375da9 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -122,28 +122,40 @@ namespace OpenSim.Region.OptionalModules
122 122
123 private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) 123 private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
124 { 124 {
125 if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) ||
126 newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1))
127 return true;
128
125 SceneObjectPart obj = scene.GetSceneObjectPart(objectID); 129 SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
126 Vector3 oldPoint = obj.GroupPosition; 130
127 int objectCount = obj.ParentGroup.PrimCount; 131 if (obj == null)
128 ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); 132 return false;
133
134 // Prim counts are determined by the location of the root prim. if we're
135 // moving a child prim, just let it pass
136 if (!obj.IsRoot)
137 {
138 return true;
139 }
140
129 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); 141 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
130 142
131 int usedPrims = newParcel.PrimCounts.Total; 143 if (newParcel == null)
132 int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); 144 return true;
145
146 Vector3 oldPoint = obj.GroupPosition;
147 ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
133 148
134 // The prim hasn't crossed a region boundry so we don't need to worry 149 // The prim hasn't crossed a region boundry so we don't need to worry
135 // about prim counts here 150 // about prim counts here
136 if(oldParcel.Equals(newParcel)) 151 if(oldParcel != null && oldParcel.Equals(newParcel))
137 { 152 {
138 return true; 153 return true;
139 } 154 }
140 155
141 // Prim counts are determined by the location of the root prim. if we're 156 int objectCount = obj.ParentGroup.PrimCount;
142 // moving a child prim, just let it pass 157 int usedPrims = newParcel.PrimCounts.Total;
143 if(!obj.IsRoot) 158 int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
144 {
145 return true;
146 }
147 159
148 // TODO: Add Special Case here for temporary prims 160 // TODO: Add Special Case here for temporary prims
149 161
@@ -172,4 +184,4 @@ namespace OpenSim.Region.OptionalModules
172 return true; 184 return true;
173 } 185 }
174 } 186 }
175} \ No newline at end of file 187}