Correct llGetParcelMaxPrims() to use the same calculation as used elsewhere instead of the old 0.22 prims/meter squared fudge factor.

Thanks to tglion for this.
0.7.1-dev
Justin Clark-Casey (justincc) 2011-05-14 01:26:04 +01:00
parent 9780d1775b
commit c71253bdf1
1 changed files with 5 additions and 6 deletions

View File

@ -9908,8 +9908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide) public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
// Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation
// Which probably will be irrelevent in OpenSim....
LandData land = World.GetLandData((float)pos.x, (float)pos.y); LandData land = World.GetLandData((float)pos.x, (float)pos.y);
float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus;
@ -9921,16 +9920,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (sim_wide != 0) if (sim_wide != 0)
{ {
decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; int v = (int)((land.SimwideArea / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return (int)v; return v;
} }
else else
{ {
decimal v = land.Area * (decimal)(0.22) * (decimal)bonusfactor; int v = (int)((land.Area / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor);
return (int)v; return v;
} }
} }