From d5c724e5b8cc15ce278b80070238e72a2e4ea0e8 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 Apr 2012 01:51:57 +0100
Subject: Add regression test for prim status when root prim in a new linkset
is non-physical
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
.../Framework/Scenes/Tests/SceneObjectStatusTests.cs | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index d2cd37d..1592131 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1708,7 +1708,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (ParentGroup.Scene == null)
return;
-
+
if (!ParentGroup.Scene.PhysicalPrims && UsePhysics)
return;
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 91f4a34..8cdd645 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -131,5 +131,24 @@ namespace OpenSim.Region.Framework.Scenes.Tests
Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
}
+
+ ///
+ /// Test that linking results in the correct physical status for all linkees.
+ ///
+ [Test]
+ public void TestLinkPhysicsChildPhysicalOnly()
+ {
+ TestHelpers.InMethod();
+
+ m_scene.AddSceneObject(m_so1);
+ m_scene.AddSceneObject(m_so2);
+
+ m_so2.ScriptSetPhysicsStatus(true);
+
+ m_scene.LinkObjects(m_ownerId, m_so1.LocalId, new List() { m_so2.LocalId });
+
+ Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.None));
+ Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.None));
+ }
}
}
\ No newline at end of file
--
cgit v1.1