simplify code in llGetParcelMaxPrims() to use existing code in LandObject rather than duping the algo

bulletsim
Justin Clark-Casey (justincc) 2011-05-14 02:34:46 +01:00
parent 1d86079141
commit bef1ffa7db
1 changed files with 4 additions and 18 deletions

View File

@ -9909,29 +9909,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{
m_host.AddScriptLPS(1);
LandData land = World.GetLandData((float)pos.x, (float)pos.y);
ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y);
float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus;
if (land == null)
{
if (lo == null)
return 0;
}
if (sim_wide != 0)
{
int v = (int)((land.SimwideArea / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return v;
}
return lo.GetSimulatorMaxPrimCount(lo);
else
{
int v = (int)((land.Area / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return v;
}
return lo.GetParcelMaxPrimCount(lo);
}
public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param)