aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorubit2012-11-04 16:00:41 +0100
committerubit2012-11-04 16:00:41 +0100
commit4737839b3aa7aa4e207020fac4e73fedd59f7b70 (patch)
tree53756061a81272baf8d3d231637d8e78a9b2892a /OpenSim
parentMerge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff)
parent removed potencial null refs and rearrange code a bit (diff)
downloadopensim-SC_OLD-4737839b3aa7aa4e207020fac4e73fedd59f7b70.zip
opensim-SC_OLD-4737839b3aa7aa4e207020fac4e73fedd59f7b70.tar.gz
opensim-SC_OLD-4737839b3aa7aa4e207020fac4e73fedd59f7b70.tar.bz2
opensim-SC_OLD-4737839b3aa7aa4e207020fac4e73fedd59f7b70.tar.xz
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs32
1 files changed, 19 insertions, 13 deletions
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index 59ff9b8..39cabb5 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -121,34 +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 > 257f || newPoint.X < -1f || newPoint.Y > 257f || newPoint.Y < -1f)) 124 if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) ||
125 newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1))
125 return true; 126 return true;
126 127
127 SceneObjectPart obj = scene.GetSceneObjectPart(objectID); 128 SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
128 Vector3 oldPoint = obj.GroupPosition; 129
129 int objectCount = obj.ParentGroup.PrimCount; 130 if (obj == null)
130 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
131 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); 140 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
132 141
133 if (newParcel == null) 142 if (newParcel == null)
134 return true; 143 return true;
135 144
136 int usedPrims = newParcel.PrimCounts.Total; 145 Vector3 oldPoint = obj.GroupPosition;
137 int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); 146 ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
138 147
139 // 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
140 // about prim counts here 149 // about prim counts here
141 if(oldParcel.Equals(newParcel)) 150 if(oldParcel != null && oldParcel.Equals(newParcel))
142 { 151 {
143 return true; 152 return true;
144 } 153 }
145 154
146 // Prim counts are determined by the location of the root prim. if we're 155 int objectCount = obj.ParentGroup.PrimCount;
147 // moving a child prim, just let it pass 156 int usedPrims = newParcel.PrimCounts.Total;
148 if(!obj.IsRoot) 157 int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
149 {
150 return true;
151 }
152 158
153 // TODO: Add Special Case here for temporary prims 159 // TODO: Add Special Case here for temporary prims
154 160