switch llGetParcelPrimCount() to use new prim counts module

0.7.1-dev
Justin Clark-Casey (justincc) 2011-04-05 20:31:52 +01:00
parent 3d400fc663
commit dc6ce24443
1 changed files with 40 additions and 47 deletions

View File

@ -9836,62 +9836,55 @@ 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);
if (land == null) //LandData land = World.GetLandData((float)pos.x, (float)pos.y);
{
if (lo == null)
return 0; return 0;
}
else IPrimCounts pc = lo.PrimCounts;
{
if (sim_wide != 0) if (sim_wide != 0)
{ {
if (category == 0) if (category == 0)
{ {
return land.SimwidePrims; return pc.Simulator;
} }
else else
{ {
//public int simwideArea = 0; // counts not implemented yet
return 0; return 0;
} }
} }
else else
{ {
if (category == 0)//Total Prims if (category == 0)//Total Prims
{ {
return 0;//land. return pc.Total;
} }
else if (category == 1)//Owner Prims else if (category == 1)//Owner Prims
{ {
return land.OwnerPrims; return pc.Owner;
} }
else if (category == 2)//Group Prims else if (category == 2)//Group Prims
{ {
return land.GroupPrims; return pc.Group;
} }
else if (category == 3)//Other Prims else if (category == 3)//Other Prims
{ {
return land.OtherPrims; return pc.Others;
} }
else if (category == 4)//Selected else if (category == 4)//Selected
{ {
return land.SelectedPrims; return pc.Selected;
} }
else if (category == 5)//Temp else if (category == 5)//Temp
{ {
return 0;//land. return 0; // counts not implemented yet
}
} }
} }
return 0; return 0;
} }