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