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); 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 (lo == null)
if (land == null)
{
return 0; return 0;
}
if (sim_wide != 0) if (sim_wide != 0)
{ return lo.GetSimulatorMaxPrimCount(lo);
int v = (int)((land.SimwideArea / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return v;
}
else else
{ return lo.GetParcelMaxPrimCount(lo);
int v = (int)((land.Area / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return v;
}
} }
public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param)