Fix prim calculations so that > 32767 prims are supported

avinationmerge
Melanie 2012-01-17 15:30:52 +01:00
parent 747c25e920
commit 5afb70b9fe
2 changed files with 5 additions and 3 deletions

View File

@ -4612,7 +4612,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (landData.SimwideArea > 0)
{
int simulatorCapacity = (int)((double)(landData.SimwideArea * m_scene.RegionInfo.ObjectCapacity) * m_scene.RegionInfo.RegionSettings.ObjectBonus) / 65536;
int simulatorCapacity = (int)((long)landData.SimwideArea * (long)m_scene.RegionInfo.ObjectCapacity * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus / 65536L);
// Never report more than sim total capacity
if (simulatorCapacity > m_scene.RegionInfo.ObjectCapacity)
simulatorCapacity = m_scene.RegionInfo.ObjectCapacity;

View File

@ -194,6 +194,7 @@ namespace OpenSim.Region.CoreModules.World.Land
* m_scene.RegionInfo.ObjectCapacity)
* m_scene.RegionInfo.RegionSettings.ObjectBonus)
/ 65536;
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;
}
}
@ -223,8 +224,9 @@ namespace OpenSim.Region.CoreModules.World.Land
else
{
//Normal Calculations
int simMax = (int)(((float)LandData.SimwideArea / 65536.0f)
* (float)m_scene.RegionInfo.ObjectCapacity);
int simMax = (int)((long)LandData.SimwideArea
* (long)m_scene.RegionInfo.ObjectCapacity / 65536L);
m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax);
return simMax;
}
}