From 8e15d4ad57de6f2a0c900968ef778fba7cdced63 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 8 Sep 2014 23:58:49 +0100 Subject: limit number of prims on physical objects. Not all cases covered still --- .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b569194..bb083fa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1400,6 +1400,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api SceneObjectGroup group = m_host.ParentGroup; bool allow = true; + int maxprims = World.m_linksetPhysCapacity; + bool checkShape = (maxprims > 0 && group.PrimCount > maxprims); + foreach (SceneObjectPart part in group.Parts) { if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) @@ -1407,6 +1410,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api allow = false; break; } + if (checkShape && part.PhysicsShapeType != (byte)PhysicsShapeType.None) + { + if (--maxprims < 0) + { + allow = false; + break; + } + } } if (!allow) -- cgit v1.1