diff options
author | Justin Clark-Casey (justincc) | 2011-04-05 20:39:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-05 20:39:58 +0100 |
commit | f030ba8992a17553b5824955c95096b8326b23c8 (patch) | |
tree | 7c4ad6fd04dbc4357da8c039260bd4f84b49d381 /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | switch llGetParcelPrimCount() to use new prim counts module (diff) | |
download | opensim-SC_OLD-f030ba8992a17553b5824955c95096b8326b23c8.zip opensim-SC_OLD-f030ba8992a17553b5824955c95096b8326b23c8.tar.gz opensim-SC_OLD-f030ba8992a17553b5824955c95096b8326b23c8.tar.bz2 opensim-SC_OLD-f030ba8992a17553b5824955c95096b8326b23c8.tar.xz |
replace magic numbers in llGetParcelPrimCount() with constants
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 30 |
1 files changed, 8 insertions, 22 deletions
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 | |||
9837 | m_host.AddScriptLPS(1); | 9837 | m_host.AddScriptLPS(1); |
9838 | 9838 | ||
9839 | ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); | 9839 | ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); |
9840 | |||
9841 | //LandData land = World.GetLandData((float)pos.x, (float)pos.y); | ||
9842 | 9840 | ||
9843 | if (lo == null) | 9841 | if (lo == null) |
9844 | return 0; | 9842 | return 0; |
9845 | 9843 | ||
9846 | IPrimCounts pc = lo.PrimCounts; | 9844 | IPrimCounts pc = lo.PrimCounts; |
9847 | 9845 | ||
9848 | if (sim_wide != 0) | 9846 | if (sim_wide != ScriptBaseClass.FALSE) |
9849 | { | 9847 | { |
9850 | if (category == 0) | 9848 | if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL) |
9851 | { | 9849 | { |
9852 | return pc.Simulator; | 9850 | return pc.Simulator; |
9853 | } | 9851 | } |
@@ -9859,30 +9857,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9859 | } | 9857 | } |
9860 | else | 9858 | else |
9861 | { | 9859 | { |
9862 | if (category == 0)//Total Prims | 9860 | if (category == ScriptBaseClass.PARCEL_COUNT_TOTAL) |
9863 | { | ||
9864 | return pc.Total; | 9861 | return pc.Total; |
9865 | } | 9862 | else if (category == ScriptBaseClass.PARCEL_COUNT_OWNER) |
9866 | else if (category == 1)//Owner Prims | ||
9867 | { | ||
9868 | return pc.Owner; | 9863 | return pc.Owner; |
9869 | } | 9864 | else if (category == ScriptBaseClass.PARCEL_COUNT_GROUP) |
9870 | else if (category == 2)//Group Prims | ||
9871 | { | ||
9872 | return pc.Group; | 9865 | return pc.Group; |
9873 | } | 9866 | else if (category == ScriptBaseClass.PARCEL_COUNT_OTHER) |
9874 | else if (category == 3)//Other Prims | ||
9875 | { | ||
9876 | return pc.Others; | 9867 | return pc.Others; |
9877 | } | 9868 | else if (category == ScriptBaseClass.PARCEL_COUNT_SELECTED) |
9878 | else if (category == 4)//Selected | ||
9879 | { | ||
9880 | return pc.Selected; | 9869 | return pc.Selected; |
9881 | } | 9870 | else if (category == ScriptBaseClass.PARCEL_COUNT_TEMP) |
9882 | else if (category == 5)//Temp | ||
9883 | { | ||
9884 | return 0; // counts not implemented yet | 9871 | return 0; // counts not implemented yet |
9885 | } | ||
9886 | } | 9872 | } |
9887 | 9873 | ||
9888 | return 0; | 9874 | return 0; |