replace magic numbers in llGetParcelPrimCount() with constants

0.7.1-dev
Justin Clark-Casey (justincc) 2011-04-05 20:39:58 +01:00
parent dc6ce24443
commit f030ba8992
1 changed files with 8 additions and 22 deletions

View File

@ -9838,16 +9838,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y);
//LandData land = World.GetLandData((float)pos.x, (float)pos.y);
if (lo == null) if (lo == null)
return 0; return 0;
IPrimCounts pc = lo.PrimCounts; IPrimCounts pc = lo.PrimCounts;
if (sim_wide != 0) if (sim_wide != ScriptBaseClass.FALSE)
{ {
if (category == 0) if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL)
{ {
return pc.Simulator; return pc.Simulator;
} }
@ -9859,31 +9857,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
else else
{ {
if (category == 0)//Total Prims if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL)
{
return pc.Total; return pc.Total;
} else if (category == ScriptBaseClass.PARCEL_COUNT_OWNER)
else if (category == 1)//Owner Prims
{
return pc.Owner; return pc.Owner;
} else if (category == ScriptBaseClass.PARCEL_COUNT_GROUP)
else if (category == 2)//Group Prims
{
return pc.Group; return pc.Group;
} else if (category == ScriptBaseClass.PARCEL_COUNT_OTHER)
else if (category == 3)//Other Prims
{
return pc.Others; return pc.Others;
} else if (category == ScriptBaseClass.PARCEL_COUNT_SELECTED)
else if (category == 4)//Selected
{
return pc.Selected; return pc.Selected;
} else if (category == ScriptBaseClass.PARCEL_COUNT_TEMP)
else if (category == 5)//Temp
{
return 0; // counts not implemented yet return 0; // counts not implemented yet
} }
}
return 0; return 0;
} }