Harmonizing SP with Avination

iar_mods
Melanie 2011-12-22 16:48:52 +00:00
parent 219ec7ef20
commit 2347593dac
1 changed files with 57 additions and 43 deletions

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
/// TODO: For some reason, we effectively have a list both here and in Appearance. Need to work out if this is
/// necessary.
/// </remarks>
protected List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
private List<SceneObjectGroup> m_attachments = new List<SceneObjectGroup>();
public Object AttachmentsSyncLock { get; private set; }
@ -550,8 +550,12 @@ namespace OpenSim.Region.Framework.Scenes
}
}
// Don't update while sitting
if (ParentID == 0)
{
m_pos = value;
ParentPosition = Vector3.Zero;
}
//m_log.DebugFormat(
// "[ENTITY BASE]: In {0} set AbsolutePosition of {1} to {2}",
@ -566,6 +570,13 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 OffsetPosition
{
get { return m_pos; }
set
{
// There is no offset position when not seated
if (ParentID == 0)
return;
m_pos = value;
}
}
/// <summary>
@ -2740,8 +2751,10 @@ namespace OpenSim.Region.Framework.Scenes
if (IsChildAgent)
return;
// We only do this if we have a physics actor or we're sitting on something
if (ParentID == 0 && PhysicsActor != null || ParentID != 0)
if (ParentID != 0)
return;
if (!IsInTransit)
{
Vector3 pos2 = AbsolutePosition;
Vector3 vel = Velocity;
@ -3100,16 +3113,15 @@ namespace OpenSim.Region.Framework.Scenes
catch { }
// Attachment objects
lock (m_attachments)
{
if (m_attachments.Count > 0)
List<SceneObjectGroup> attachments = GetAttachments();
if (attachments.Count > 0)
{
cAgent.AttachmentObjects = new List<ISceneObject>();
cAgent.AttachmentObjectStates = new List<string>();
// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
InTransitScriptStates.Clear();
foreach (SceneObjectGroup sog in m_attachments)
foreach (SceneObjectGroup sog in attachments)
{
// We need to make a copy and pass that copy
// because of transfers withn the same sim
@ -3126,7 +3138,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
}
private void CopyFrom(AgentData cAgent)
{
@ -3530,6 +3541,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="eventName">The name of the event</param>
/// <param name="args">The arguments for the event</param>
public void SendScriptEventToAttachments(string eventName, Object[] args)
{
Util.FireAndForget(delegate(object x)
{
if (m_scriptEngines.Length == 0)
return;
@ -3551,6 +3564,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
});
}
internal void PushForce(Vector3 impulse)