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

@ -9835,63 +9835,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide) public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y);
//LandData land = World.GetLandData((float)pos.x, (float)pos.y);
LandData land = World.GetLandData((float)pos.x, (float)pos.y); if (lo == null)
if (land == null)
{
return 0; return 0;
}
IPrimCounts pc = lo.PrimCounts;
else if (sim_wide != 0)
{ {
if (sim_wide != 0) if (category == 0)
{ {
if (category == 0) return pc.Simulator;
{
return land.SimwidePrims;
}
else
{
//public int simwideArea = 0;
return 0;
}
} }
else else
{ {
if (category == 0)//Total Prims // counts not implemented yet
{ return 0;
return 0;//land.
}
else if (category == 1)//Owner Prims
{
return land.OwnerPrims;
}
else if (category == 2)//Group Prims
{
return land.GroupPrims;
}
else if (category == 3)//Other Prims
{
return land.OtherPrims;
}
else if (category == 4)//Selected
{
return land.SelectedPrims;
}
else if (category == 5)//Temp
{
return 0;//land.
}
} }
} }
else
{
if (category == 0)//Total Prims
{
return pc.Total;
}
else if (category == 1)//Owner Prims
{
return pc.Owner;
}
else if (category == 2)//Group Prims
{
return pc.Group;
}
else if (category == 3)//Other Prims
{
return pc.Others;
}
else if (category == 4)//Selected
{
return pc.Selected;
}
else if (category == 5)//Temp
{
return 0; // counts not implemented yet
}
}
return 0; return 0;
} }