From dc6ce2444385730a3ea1ba1104f2e2caa15a907a Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 5 Apr 2011 20:31:52 +0100 Subject: [PATCH] switch llGetParcelPrimCount() to use new prim counts module --- .../Shared/Api/Implementation/LSL_Api.cs | 87 +++++++++---------- 1 file changed, 40 insertions(+), 47 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 43b0da320e..5f8ca91550 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 public LSL_Integer llGetParcelPrimCount(LSL_Vector pos, int category, int sim_wide) { 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); - LandData land = World.GetLandData((float)pos.x, (float)pos.y); - - if (land == null) - { + if (lo == null) return 0; - } + + IPrimCounts pc = lo.PrimCounts; - else + 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; }