From f030ba8992a17553b5824955c95096b8326b23c8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 5 Apr 2011 20:39:58 +0100 Subject: replace magic numbers in llGetParcelPrimCount() with constants --- .../Shared/Api/Implementation/LSL_Api.cs | 30 ++++++---------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5f8ca91..e5be641 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9837,17 +9837,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api 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); if (lo == null) return 0; 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; } @@ -9859,30 +9857,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } else { - if (category == 0)//Total Prims - { + if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL) return pc.Total; - } - else if (category == 1)//Owner Prims - { + else if (category == ScriptBaseClass.PARCEL_COUNT_OWNER) return pc.Owner; - } - else if (category == 2)//Group Prims - { + else if (category == ScriptBaseClass.PARCEL_COUNT_GROUP) return pc.Group; - } - else if (category == 3)//Other Prims - { + else if (category == ScriptBaseClass.PARCEL_COUNT_OTHER) return pc.Others; - } - else if (category == 4)//Selected - { + else if (category == ScriptBaseClass.PARCEL_COUNT_SELECTED) return pc.Selected; - } - else if (category == 5)//Temp - { + else if (category == ScriptBaseClass.PARCEL_COUNT_TEMP) return 0; // counts not implemented yet - } } return 0; -- cgit v1.1