tell scripts about positions changes after they are actually changed

avinationmerge
UbitUmarov 2014-07-22 14:50:17 +01:00
parent 5269511339
commit cf132430ae
1 changed files with 18 additions and 10 deletions

View File

@ -687,23 +687,31 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
// Restuff the new GroupPosition into each SOP of the linkset.
// This has the affect of resetting and tainting the physics actors.
SceneObjectPart[] parts = m_parts.GetArray();
bool triggerScriptEvent = m_rootPart.GroupPosition != val; bool triggerScriptEvent = m_rootPart.GroupPosition != val;
if (m_dupeInProgress) if (m_dupeInProgress || IsDeleted)
triggerScriptEvent = false; triggerScriptEvent = false;
m_rootPart.GroupPosition = val; m_rootPart.GroupPosition = val;
if (triggerScriptEvent)
m_rootPart.TriggerScriptChangedEvent(Changed.POSITION); // 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
SceneObjectPart[] parts = m_parts.GetArray();
foreach (SceneObjectPart part in parts) foreach (SceneObjectPart part in parts)
{ {
if (part == m_rootPart) if (part != m_rootPart)
continue;
part.GroupPosition = val; part.GroupPosition = val;
}
// now that position is changed tell it to scripts
if (triggerScriptEvent) if (triggerScriptEvent)
{
foreach (SceneObjectPart part in parts)
{
part.TriggerScriptChangedEvent(Changed.POSITION); part.TriggerScriptChangedEvent(Changed.POSITION);
} }
}
/* /*
This seems not needed and should not be needed: This seems not needed and should not be needed: