mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
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:
@@ -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)
|
||||
//{
|
||||
|
||||
Reference in New Issue
Block a user