diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 49 |
1 files changed, 38 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 7492601..f85d3d9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -3386,10 +3386,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3386 | } | 3386 | } |
3387 | lockPartsForRead(false); | 3387 | lockPartsForRead(false); |
3388 | 3388 | ||
3389 | AbsolutePosition = newPos; | 3389 | //We have to set undoing here because otherwise an undo state will be saved |
3390 | if (!m_rootPart.Undoing) | ||
3391 | { | ||
3392 | m_rootPart.Undoing = true; | ||
3393 | AbsolutePosition = newPos; | ||
3394 | m_rootPart.Undoing = false; | ||
3395 | } | ||
3396 | else | ||
3397 | { | ||
3398 | AbsolutePosition = newPos; | ||
3399 | } | ||
3390 | 3400 | ||
3391 | HasGroupChanged = true; | 3401 | HasGroupChanged = true; |
3392 | ScheduleGroupForTerseUpdate(); | 3402 | if (m_rootPart.Undoing) |
3403 | { | ||
3404 | ScheduleGroupForFullUpdate(); | ||
3405 | } | ||
3406 | else | ||
3407 | { | ||
3408 | ScheduleGroupForTerseUpdate(); | ||
3409 | } | ||
3393 | } | 3410 | } |
3394 | 3411 | ||
3395 | public void OffsetForNewRegion(Vector3 offset) | 3412 | public void OffsetForNewRegion(Vector3 offset) |
@@ -3488,7 +3505,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3488 | if (part.UUID == m_rootPart.UUID) | 3505 | if (part.UUID == m_rootPart.UUID) |
3489 | { | 3506 | { |
3490 | UpdateRootRotation(rot); | 3507 | UpdateRootRotation(rot); |
3491 | AbsolutePosition = pos; | 3508 | if (!m_rootPart.Undoing) |
3509 | { | ||
3510 | m_rootPart.Undoing = true; | ||
3511 | AbsolutePosition = pos; | ||
3512 | m_rootPart.Undoing = false; | ||
3513 | } | ||
3514 | else | ||
3515 | { | ||
3516 | AbsolutePosition = pos; | ||
3517 | } | ||
3492 | } | 3518 | } |
3493 | else | 3519 | else |
3494 | { | 3520 | { |
@@ -3511,6 +3537,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3511 | Quaternion oldParentRot = m_rootPart.RotationOffset; | 3537 | Quaternion oldParentRot = m_rootPart.RotationOffset; |
3512 | 3538 | ||
3513 | m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION); | 3539 | m_rootPart.StoreUndoState(UndoType.STATE_PRIM_ROTATION); |
3540 | bool cancelUndo = false; | ||
3541 | if (!m_rootPart.Undoing) | ||
3542 | { | ||
3543 | m_rootPart.Undoing = true; | ||
3544 | cancelUndo = true; | ||
3545 | } | ||
3514 | m_rootPart.UpdateRotation(rot); | 3546 | m_rootPart.UpdateRotation(rot); |
3515 | if (m_rootPart.PhysActor != null) | 3547 | if (m_rootPart.PhysActor != null) |
3516 | { | 3548 | { |
@@ -3534,18 +3566,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3534 | newRot *= Quaternion.Inverse(axRot); | 3566 | newRot *= Quaternion.Inverse(axRot); |
3535 | prim.RotationOffset = newRot; | 3567 | prim.RotationOffset = newRot; |
3536 | prim.ScheduleTerseUpdate(); | 3568 | prim.ScheduleTerseUpdate(); |
3569 | prim.IgnoreUndoUpdate = false; | ||
3537 | } | 3570 | } |
3538 | } | 3571 | } |
3539 | 3572 | if (cancelUndo == true) | |
3540 | foreach (SceneObjectPart childpart in Children.Values) | ||
3541 | { | 3573 | { |
3542 | if (childpart != m_rootPart) | 3574 | m_rootPart.Undoing = false; |
3543 | { | ||
3544 | childpart.IgnoreUndoUpdate = false; | ||
3545 | childpart.StoreUndoState(UndoType.STATE_PRIM_ROTATION); | ||
3546 | } | ||
3547 | } | 3575 | } |
3548 | |||
3549 | lockPartsForRead(false); | 3576 | lockPartsForRead(false); |
3550 | 3577 | ||
3551 | m_rootPart.ScheduleTerseUpdate(); | 3578 | m_rootPart.ScheduleTerseUpdate(); |