From b1cb4f5b04f076c067842de6971ec1016b9a3912 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 11 Nov 2011 21:42:58 +0000 Subject: As per mailing list last week, remove facility that would automatically move the avatar if prim with no sit target was out of sitting range. Now, no movement occurs. Note that you can still sit on a prim with an explicit sit target from any distance, as was the case before. --- .../Scenes/Tests/ScenePresenceSitTests.cs | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs index 2636473..a1d30f3 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceSitTests.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSitOutsideRange() + public void TestSitOutsideRangeNoTarget() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] - public void TestSitWithinRange() + public void TestSitWithinRangeNoTarget() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); @@ -124,5 +124,34 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero)); Assert.That(sp.ParentID, Is.EqualTo(0)); } + + [Test] + public void TestSitAndStandWithSitTarget() + { + TestHelpers.InMethod(); +// log4net.Config.XmlConfigurator.Configure(); + + ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1)); + + // If a prim has a sit target then we can sit from any distance away + Vector3 startPos = new Vector3(128, 128, 30); + sp.AbsolutePosition = startPos; + + SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene); + part.SitTargetPosition = new Vector3(0, 0, 1); + + sp.HandleAgentRequestSit(sp.ControllingClient, sp.UUID, part.UUID, Vector3.Zero); + + Assert.That(part.SitTargetAvatar, Is.EqualTo(sp.UUID)); + Assert.That(sp.ParentID, Is.EqualTo(part.LocalId)); + Assert.That( + sp.AbsolutePosition, + Is.EqualTo(part.AbsolutePosition + part.SitTargetPosition + ScenePresence.SIT_TARGET_ADJUSTMENT)); + + sp.StandUp(); + + Assert.That(part.SitTargetAvatar, Is.EqualTo(UUID.Zero)); + Assert.That(sp.ParentID, Is.EqualTo(0)); + } } } \ No newline at end of file -- cgit v1.1