Make sure the avatar position gets moved along with a prim it is sitting on. This fixes mantis #208 and (maybe) issues with chat and sound coming from the wrong place when sat on a vehicle.

This commit is contained in:
Tom
2010-08-06 06:37:40 -07:00
parent 0a004f8c44
commit a636af13e7
3 changed files with 32 additions and 16 deletions

View File

@@ -469,13 +469,22 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
}
foreach (SceneObjectPart part in m_parts.Values)
List<SceneObjectPart> parts = new List<SceneObjectPart>(m_parts.Values);
lockPartsForRead(false);
foreach (SceneObjectPart part in parts)
{
part.IgnoreUndoUpdate = false;
part.StoreUndoState(UndoType.STATE_GROUP_POSITION);
part.GroupPosition = val;
}
lockPartsForRead(false);
foreach (ScenePresence av in m_linkedAvatars)
{
Vector3 offset = m_parts[av.LinkedPrim].GetWorldPosition() - av.ParentPosition;
av.AbsolutePosition += offset;
av.ParentPosition = m_parts[av.LinkedPrim].GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
av.SendFullUpdateToAllClients();
}
//if (m_rootPart.PhysActor != null)
//{