diff options
author | Justin Clark-Casey (justincc) | 2011-04-05 20:31:52 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-05 20:31:52 +0100 |
commit | dc6ce2444385730a3ea1ba1104f2e2caa15a907a (patch) | |
tree | e7b8f2b530ec8e744584d883b5ed2783a8d06f16 /OpenSim/Region/ScriptEngine/Shared | |
parent | If an object is selected, then don't include it in owner/group/others prim co... (diff) | |
download | opensim-SC-dc6ce2444385730a3ea1ba1104f2e2caa15a907a.zip opensim-SC-dc6ce2444385730a3ea1ba1104f2e2caa15a907a.tar.gz opensim-SC-dc6ce2444385730a3ea1ba1104f2e2caa15a907a.tar.bz2 opensim-SC-dc6ce2444385730a3ea1ba1104f2e2caa15a907a.tar.xz |
switch llGetParcelPrimCount() to use new prim counts module
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 85 |
1 files changed, 39 insertions, 46 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 43b0da3..5f8ca91 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -9835,63 +9835,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9835 | public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide) | 9835 | public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide) |
9836 | { | 9836 | { |
9837 | m_host.AddScriptLPS(1); | 9837 | m_host.AddScriptLPS(1); |
9838 | |||
9839 | ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); | ||
9840 | |||
9841 | //LandData land = World.GetLandData((float)pos.x, (float)pos.y); | ||
9838 | 9842 | ||
9839 | LandData land = World.GetLandData((float)pos.x, (float)pos.y); | 9843 | if (lo == null) |
9844 | return 0; | ||
9845 | |||
9846 | IPrimCounts pc = lo.PrimCounts; | ||
9840 | 9847 | ||
9841 | if (land == null) | 9848 | if (sim_wide != 0) |
9842 | { | 9849 | { |
9843 | return 0; | 9850 | if (category == 0) |
9851 | { | ||
9852 | return pc.Simulator; | ||
9853 | } | ||
9854 | else | ||
9855 | { | ||
9856 | // counts not implemented yet | ||
9857 | return 0; | ||
9858 | } | ||
9844 | } | 9859 | } |
9845 | |||
9846 | else | 9860 | else |
9847 | { | 9861 | { |
9848 | if (sim_wide != 0) | 9862 | if (category == 0)//Total Prims |
9849 | { | 9863 | { |
9850 | if (category == 0) | 9864 | return pc.Total; |
9851 | { | ||
9852 | return land.SimwidePrims; | ||
9853 | } | ||
9854 | |||
9855 | else | ||
9856 | { | ||
9857 | //public int simwideArea = 0; | ||
9858 | return 0; | ||
9859 | } | ||
9860 | } | 9865 | } |
9861 | 9866 | else if (category == 1)//Owner Prims | |
9862 | else | ||
9863 | { | 9867 | { |
9864 | if (category == 0)//Total Prims | 9868 | return pc.Owner; |
9865 | { | 9869 | } |
9866 | return 0;//land. | 9870 | else if (category == 2)//Group Prims |
9867 | } | 9871 | { |
9868 | 9872 | return pc.Group; | |
9869 | else if (category == 1)//Owner Prims | 9873 | } |
9870 | { | 9874 | else if (category == 3)//Other Prims |
9871 | return land.OwnerPrims; | 9875 | { |
9872 | } | 9876 | return pc.Others; |
9873 | 9877 | } | |
9874 | else if (category == 2)//Group Prims | 9878 | else if (category == 4)//Selected |
9875 | { | 9879 | { |
9876 | return land.GroupPrims; | 9880 | return pc.Selected; |
9877 | } | 9881 | } |
9878 | 9882 | else if (category == 5)//Temp | |
9879 | else if (category == 3)//Other Prims | 9883 | { |
9880 | { | 9884 | return 0; // counts not implemented yet |
9881 | return land.OtherPrims; | ||
9882 | } | ||
9883 | |||
9884 | else if (category == 4)//Selected | ||
9885 | { | ||
9886 | return land.SelectedPrims; | ||
9887 | } | ||
9888 | |||
9889 | else if (category == 5)//Temp | ||
9890 | { | ||
9891 | return 0;//land. | ||
9892 | } | ||
9893 | } | 9885 | } |
9894 | } | 9886 | } |
9887 | |||
9895 | return 0; | 9888 | return 0; |
9896 | } | 9889 | } |
9897 | 9890 | ||