From 57b6398b71fbc270cc4835485fbc3ce63cc748ee Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sat, 5 Mar 2016 22:30:02 +0100
Subject: Make mesh upload respect the same parts maximum as what is set for
 the simulator

---
 OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 1 +
 OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index 91b2ee7..66b9f06 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -153,6 +153,7 @@ namespace OpenSim.Region.ClientStack.Linden
             // tell it about scene object limits
             m_ModelCost.NonPhysicalPrimScaleMax = m_Scene.m_maxNonphys;
             m_ModelCost.PhysicalPrimScaleMax = m_Scene.m_maxPhys;
+            m_ModelCost.ObjectLinkedPartsMax = m_Scene.m_linksetCapacity;
             
 //            m_ModelCost.ObjectLinkedPartsMax = ??
 //            m_ModelCost.PrimScaleMin = ??
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
index a91f3be..29bde6c 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/MeshCost.cs
@@ -140,7 +140,7 @@ namespace OpenSim.Region.ClientStack.Linden
 
             int numberInstances = resources.instance_list.Array.Count;
 
-            if( numberInstances > ObjectLinkedPartsMax )
+            if (ObjectLinkedPartsMax != 0 && numberInstances > ObjectLinkedPartsMax)
             {
                 error = "Model would have more than " + ObjectLinkedPartsMax.ToString() + " linked prims";
                 return false;
-- 
cgit v1.1