diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 94b6797..d3f5454 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -677,26 +677,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
677 | /// </summary> | 677 | /// </summary> |
678 | public override void Update() | 678 | public override void Update() |
679 | { | 679 | { |
680 | List<SceneObjectPart> parts = new List<SceneObjectPart>(m_parts.Values); | ||
681 | |||
680 | if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) | 682 | if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) |
681 | { | 683 | { |
682 | foreach (SceneObjectPart part in m_parts.Values) | 684 | foreach (SceneObjectPart part in parts) |
683 | { | 685 | { |
684 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; | 686 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; |
685 | } | 687 | } |
688 | |||
686 | lastPhysGroupPos = AbsolutePosition; | 689 | lastPhysGroupPos = AbsolutePosition; |
687 | } | 690 | } |
691 | |||
688 | if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) | 692 | if ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) |
689 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) | 693 | || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) |
690 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) | 694 | || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) |
691 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) | 695 | || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) |
692 | { | 696 | { |
693 | foreach (SceneObjectPart part in m_parts.Values) | 697 | foreach (SceneObjectPart part in parts) |
694 | { | 698 | { |
695 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; | 699 | if (part.UpdateFlag == 0) part.UpdateFlag = 1; |
696 | } | 700 | } |
701 | |||
697 | lastPhysGroupRot = GroupRotation; | 702 | lastPhysGroupRot = GroupRotation; |
698 | } | 703 | } |
699 | foreach (SceneObjectPart part in m_parts.Values) | 704 | |
705 | foreach (SceneObjectPart part in parts) | ||
700 | { | 706 | { |
701 | part.SendScheduledUpdates(); | 707 | part.SendScheduledUpdates(); |
702 | } | 708 | } |