From 1d8607914170d285f15b4d48a3ae7a17f56f6aa8 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 May 2011 01:26:04 +0100 Subject: Correct llGetParcelMaxPrims() to use the same calculation as used elsewhere instead of the old 0.22 prims/meter squared fudge factor. Thanks to tglion for this. --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index aa28fa0..bda46fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9908,8 +9908,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetParcelMaxPrims(LSL_Vector pos, int sim_wide) { m_host.AddScriptLPS(1); - // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation - // Which probably will be irrelevent in OpenSim.... + LandData land = World.GetLandData((float)pos.x, (float)pos.y); float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; @@ -9921,16 +9920,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (sim_wide != 0) { - decimal v = land.SimwideArea * (decimal)(0.22) * (decimal)bonusfactor; + int v = (int)((land.SimwideArea / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor); - return (int)v; + return v; } else { - decimal v = land.Area * (decimal)(0.22) * (decimal)bonusfactor; + int v = (int)((land.Area / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor); - return (int)v; + return v; } } -- cgit v1.1 From bef1ffa7db3c90f08b3a855e3a5d3d5c7b114549 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 May 2011 02:34:46 +0100 Subject: simplify code in llGetParcelMaxPrims() to use existing code in LandObject rather than duping the algo --- .../Shared/Api/Implementation/LSL_Api.cs | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bda46fb..2010283 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9909,29 +9909,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - LandData land = World.GetLandData((float)pos.x, (float)pos.y); - - float bonusfactor = (float)World.RegionInfo.RegionSettings.ObjectBonus; + ILandObject lo = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); - if (land == null) - { + if (lo == null) return 0; - } if (sim_wide != 0) - { - int v = (int)((land.SimwideArea / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor); - - return v; - } - + return lo.GetSimulatorMaxPrimCount(lo); else - { - int v = (int)((land.Area / 65536.0f) * (float)World.RegionInfo.ObjectCapacity * bonusfactor); - - return v; - } - + return lo.GetParcelMaxPrimCount(lo); } public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) -- cgit v1.1 From 340e3ccf16a59512f86f9c5d08bda3ca8179f53e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 14 May 2011 02:42:47 +0100 Subject: refactor: remove thisObject argument from ILandObject.Get*MaxPrimCount() instance methods since it didn't make sense to use anything other than the instance themselves. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2010283..0240227 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9915,9 +9915,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return 0; if (sim_wide != 0) - return lo.GetSimulatorMaxPrimCount(lo); + return lo.GetSimulatorMaxPrimCount(); else - return lo.GetParcelMaxPrimCount(lo); + return lo.GetParcelMaxPrimCount(); } public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) -- cgit v1.1