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);
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;
}
else
IPrimCounts pc = lo.PrimCounts;
if (sim_wide != 0)
{
if (sim_wide != 0)
if (category == 0)
{
if (category == 0)
{
return land.SimwidePrims;
}
else
{
//public int simwideArea = 0;
return 0;
}
return pc.Simulator;
}
else
{
if (category == 0)//Total Prims
{
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.
}
// counts not implemented yet
return 0;
}
}
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;
}