From 6bf521c7df9e7c151484d50ac01215bf67ec4e6e Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 4 Oct 2008 14:23:33 +0000 Subject: [PATCH] Guard against negative scale set through LSL functions --- OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 5 +++++ .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index c139fd9d8d..26f3e1d708 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -1675,6 +1675,11 @@ namespace OpenSim.Region.Environment.Scenes SceneObjectGroup objectGroup = grp; if (objectGroup != null) { + if (!grp.HasGroupChanged) + { + m_log.InfoFormat("Detaching {0} which is unchanged", grp.UUID.ToString()); + return; + } string sceneObjectXml = objectGroup.ToXmlString(); CachedUserInfo userInfo = diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 783b1e4d23..655d85c030 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1115,6 +1115,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null) return; + if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01) + return; + if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) { if (scale.x > World.m_maxPhys)