diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 69a34550a9..4cbc8b81af 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -341,10 +341,16 @@ namespace OpenSim.Region.CoreModules.World.Land else { // Normal Calculations - int parcelMax = (int)( (long)LandData.Area - * (long)m_scene.RegionInfo.ObjectCapacity - * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus - / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) ); + int parcelMax = (int)( + (double)LandData.Area + * (double)m_scene.RegionInfo.ObjectCapacity + * (double)m_scene.RegionInfo.RegionSettings.ObjectBonus + / (double)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) + + 0.5 ); + + if(parcelMax > m_scene.RegionInfo.ObjectCapacity) + parcelMax = m_scene.RegionInfo.ObjectCapacity; + //m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax); return parcelMax; } @@ -359,9 +365,14 @@ namespace OpenSim.Region.CoreModules.World.Land else { //Normal Calculations - int simMax = (int)( (long)LandData.SimwideArea - * (long)m_scene.RegionInfo.ObjectCapacity - / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) ); + int simMax = (int)( (double)LandData.SimwideArea + * (double)m_scene.RegionInfo.ObjectCapacity + * (double)m_scene.RegionInfo.RegionSettings.ObjectBonus + / (long)(m_scene.RegionInfo.RegionSizeX * m_scene.RegionInfo.RegionSizeY) + +0.5 ); + + if(simMax > m_scene.RegionInfo.ObjectCapacity) + simMax = m_scene.RegionInfo.ObjectCapacity; //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); return simMax; diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index 50a5fae06d..4ffb03bd75 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs @@ -186,8 +186,8 @@ namespace OpenSim.Region.OptionalModules { string response = null; - int simulatorCapacity = lo.GetSimulatorMaxPrimCount(); - if ((objectCount + lo.PrimCounts.Total) > simulatorCapacity) + int OwnedParcelsCapacity = lo.GetSimulatorMaxPrimCount(); + if ((objectCount + lo.PrimCounts.Total) > OwnedParcelsCapacity) { response = "Unable to rez object because the parcel is too full"; }