keep intransit flag even if deleted, dont set sog position if in transit

avinationmerge
UbitUmarov 2014-10-26 01:25:28 +00:00
parent 639f128d2c
commit 139044fc79
1 changed files with 39 additions and 42 deletions

View File

@ -552,54 +552,55 @@ namespace OpenSim.Region.Framework.Scenes
d.BeginInvoke(this, val, CrossAsyncCompleted, d); d.BeginInvoke(this, val, CrossAsyncCompleted, d);
return; return;
} }
}
if (RootPart.GetStatusSandbox())
{ if (RootPart.GetStatusSandbox())
if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{ {
RootPart.ScriptSetPhysicsStatus(false); if (Util.GetDistanceTo(RootPart.StatusSandboxPos, value) > 10)
{
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)
{ {
part.TriggerScriptChangedEvent(Changed.POSITION); if (part != m_rootPart)
part.GroupPosition = val;
} }
}
Scene.EventManager.TriggerParcelPrimCountTainted(); 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();
}
} }
} }
@ -751,11 +752,7 @@ namespace OpenSim.Region.Framework.Scenes
SOGCrossDelegate icon = (SOGCrossDelegate)iar.AsyncState; SOGCrossDelegate icon = (SOGCrossDelegate)iar.AsyncState;
SceneObjectGroup sog = icon.EndInvoke(iar); SceneObjectGroup sog = icon.EndInvoke(iar);
if (sog.IsDeleted) if (!sog.IsDeleted)
{
sog.inTransit = false; // just in case...
}
else
{ {
SceneObjectPart rootp = sog.m_rootPart; SceneObjectPart rootp = sog.m_rootPart;
Vector3 oldp = rootp.GroupPosition; Vector3 oldp = rootp.GroupPosition;