Fix misaligned sit animation on scripted sit caused by the default sit

animation being run after the scripted one.
remove-scene-viewer
Melanie 2011-11-10 20:26:14 +01:00
parent ce4560bf8f
commit 48d2300b8a
1 changed files with 6 additions and 2 deletions

View File

@ -2013,8 +2013,6 @@ namespace OpenSim.Region.Framework.Scenes
sitOrientation = avSitOrientation; sitOrientation = avSitOrientation;
autopilot = false; autopilot = false;
} }
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
pos = part.AbsolutePosition + offset; pos = part.AbsolutePosition + offset;
//if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1) //if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)
//{ //{
@ -2060,6 +2058,12 @@ namespace OpenSim.Region.Framework.Scenes
m_sitAtAutoTarget = autopilot; m_sitAtAutoTarget = autopilot;
if (!autopilot) if (!autopilot)
HandleAgentSit(remoteClient, UUID); HandleAgentSit(remoteClient, UUID);
// Moved here to avoid a race with default sit anim
// The script event needs to be raised after the default sit anim is set.
if (part != null)
part.ParentGroup.TriggerScriptChangedEvent(Changed.LINK);
} }
// public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation) // public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation)