another try to prevent double crossing

avinationmerge
UbitUmarov 2014-10-26 10:08:13 +00:00
parent e59a9a54f1
commit 6600282fe9
1 changed files with 47 additions and 53 deletions

View File

@ -530,77 +530,71 @@ namespace OpenSim.Region.Framework.Scenes
{ {
Vector3 val = value; Vector3 val = value;
if (Scene != null && !inTransit) if (!IsAttachmentCheckFull() && !Scene.LoadingPrims &&
( Scene.TestBorderCross(val, Cardinals.E) ||
Scene.TestBorderCross(val, Cardinals.W) ||
Scene.TestBorderCross(val, Cardinals.N) ||
Scene.TestBorderCross(val, Cardinals.S))
)
{ {
if ( lock (m_parts)
// (Scene.TestBorderCross(val - Vector3.UnitX, Cardinals.E)
// || Scene.TestBorderCross(val + Vector3.UnitX, Cardinals.W)
// || Scene.TestBorderCross(val - Vector3.UnitY, Cardinals.N)
// || Scene.TestBorderCross(val + Vector3.UnitY, Cardinals.S))
// Experimental change for better border crossings.
// The commented out original lines above would, it seems, trigger
// a border crossing a little early or late depending on which
// direction the object was moving.
(Scene.TestBorderCross(val, Cardinals.E)
|| Scene.TestBorderCross(val, Cardinals.W)
|| Scene.TestBorderCross(val, Cardinals.N)
|| Scene.TestBorderCross(val, Cardinals.S))
&& !IsAttachmentCheckFull() && (!Scene.LoadingPrims))
{ {
inTransit = true; if (!inTransit)
SOGCrossDelegate d = CrossAsync; {
d.BeginInvoke(this, val, CrossAsyncCompleted, d); inTransit = true;
SOGCrossDelegate d = CrossAsync;
d.BeginInvoke(this, val, CrossAsyncCompleted, d);
}
return; return;
} }
}
if (RootPart.GetStatusSandbox())
if (RootPart.GetStatusSandbox()) {
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{ {
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10) RootPart.ScriptSetPhysicsStatus(false);
{
RootPart.ScriptSetPhysicsStatus(false);
if (Scene != null) if (Scene != null)
Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"), Scene.SimChat(Utils.StringToBytes("Hit Sandbox Limit"),
ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false); ChatTypeEnum.DebugChannel, 0x7FFFFFFF, RootPart.AbsolutePosition, Name, UUID, false);
return; return;
}
} }
}
bool triggerScriptEvent = m_rootPart.GroupPosition != val; bool triggerScriptEvent = m_rootPart.GroupPosition != val;
if (m_dupeInProgress || IsDeleted) if (m_dupeInProgress || IsDeleted)
triggerScriptEvent = false; triggerScriptEvent = false;
m_rootPart.GroupPosition = val; m_rootPart.GroupPosition = val;
// Restuff the new GroupPosition into each child SOP of the linkset. // Restuff the new GroupPosition into each child SOP of the linkset.
// this is needed because physics may not have linksets but just loose SOPs in world // this is needed because physics may not have linksets but just loose SOPs in world
SceneObjectPart[] parts = m_parts.GetArray(); SceneObjectPart[] parts = m_parts.GetArray();
foreach (SceneObjectPart part in parts)
{
if (part != m_rootPart)
part.GroupPosition = val;
}
foreach (ScenePresence av in m_linkedAvatars)
{
av.sitSOGmoved();
}
// now that position is changed tell it to scripts
if (triggerScriptEvent)
{
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
if (part != m_rootPart) part.TriggerScriptChangedEvent(Changed.POSITION);
part.GroupPosition = val;
} }
foreach (ScenePresence av in m_linkedAvatars)
{
av.sitSOGmoved();
}
// now that position is changed tell it to scripts
if (triggerScriptEvent)
{
foreach (SceneObjectPart part in parts)
{
part.TriggerScriptChangedEvent(Changed.POSITION);
}
}
Scene.EventManager.TriggerParcelPrimCountTainted();
} }
Scene.EventManager.TriggerParcelPrimCountTainted();
} }
} }