From 28c4dc9be490a3beedccb17bc1b411e45cced846 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 5 Nov 2011 01:38:42 +0000 Subject: Fix NPC sitting for prims without a sit target. This is to partially address http://opensimulator.org/mantis/view.php?id=5769 We don't need to call SP.HandleAgentSit() again if we are within 10m since the autopilot won't trigger. By calling it twice, the position of the sitting NPC was wrongly adjusted, ending up near <0,0,0>. However, this change does mean that NPCs further than 10m away will not attempt to autopilot to the prim, though this code was broken anyway (is actually a different mechanism to normal NPC movmeent). Hopefully this can be addressed soon. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b77f1b6..4071159 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1096,13 +1096,21 @@ namespace OpenSim.Region.Framework.Scenes public Quaternion SitTargetOrientation { get { return m_sitTargetOrientation; } - set { m_sitTargetOrientation = value; } + set + { + m_sitTargetOrientation = value; +// m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target orientation {0} for {1} {2}", m_sitTargetOrientation, Name, LocalId); + } } public Vector3 SitTargetPosition { get { return m_sitTargetPosition; } - set { m_sitTargetPosition = value; } + set + { + m_sitTargetPosition = value; +// m_log.DebugFormat("[SCENE OBJECT PART]: Set sit target position to {0} for {1} {2}", m_sitTargetPosition, Name, LocalId); + } } // This sort of sucks, but I'm adding these in to make some of -- cgit v1.1