From 9ac48b2aff2ddd00821b7e6ecd71ce134f7a0f25 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 21 Apr 2012 01:43:09 +0100
Subject: Fix a bug where linking a non-physical prim with a physical prim as
root would make the non-physical prim phantom rather than part of the physics
object.
On region restart, the whole object would become physical as expected.
Observed behaviour from elsewhere is that all prims in a new linkset should take on the status of the root prim.
Add regression test for this behaviour.
---
.../Framework/Scenes/Tests/SceneObjectStatusTests.cs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/Tests')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
index 6270ac1..91f4a34 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs
@@ -112,5 +112,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 TestLinkPhysicsRootPhysicalOnly()
+ {
+ TestHelpers.InMethod();
+
+ m_scene.AddSceneObject(m_so1);
+ m_scene.AddSceneObject(m_so2);
+
+ m_so1.ScriptSetPhysicsStatus(true);
+
+ m_scene.LinkObjects(m_ownerId, m_so1.LocalId, new List() { m_so2.LocalId });
+
+ Assert.That(m_so1.RootPart.Flags, Is.EqualTo(PrimFlags.Physics));
+ Assert.That(m_so1.Parts[1].Flags, Is.EqualTo(PrimFlags.Physics));
+ }
}
}
\ No newline at end of file
--
cgit v1.1