diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 228 |
1 files changed, 148 insertions, 80 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8ad35d3..5abf9dd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -62,7 +62,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
62 | TELEPORT = 512, | 62 | TELEPORT = 512, |
63 | REGION_RESTART = 1024, | 63 | REGION_RESTART = 1024, |
64 | MEDIA = 2048, | 64 | MEDIA = 2048, |
65 | ANIMATION = 16384 | 65 | ANIMATION = 16384, |
66 | POSITION = 32768 | ||
66 | } | 67 | } |
67 | 68 | ||
68 | // I don't really know where to put this except here. | 69 | // I don't really know where to put this except here. |
@@ -190,7 +191,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
190 | 191 | ||
191 | public UUID FromFolderID; | 192 | public UUID FromFolderID; |
192 | 193 | ||
193 | 194 | // The following two are to hold the attachment data | |
195 | // while an object is inworld | ||
196 | [XmlIgnore] | ||
197 | public byte AttachPoint = 0; | ||
198 | |||
199 | [XmlIgnore] | ||
200 | public Vector3 AttachOffset = Vector3.Zero; | ||
201 | |||
202 | [XmlIgnore] | ||
194 | public int STATUS_ROTATE_X; | 203 | public int STATUS_ROTATE_X; |
195 | 204 | ||
196 | 205 | ||
@@ -272,6 +281,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
272 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; | 281 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; |
273 | private Vector3 m_sitTargetPosition; | 282 | private Vector3 m_sitTargetPosition; |
274 | private string m_sitAnimation = "SIT"; | 283 | private string m_sitAnimation = "SIT"; |
284 | private bool m_occupied; // KF if any av is sitting on this prim | ||
275 | private string m_text = String.Empty; | 285 | private string m_text = String.Empty; |
276 | private string m_touchName = String.Empty; | 286 | private string m_touchName = String.Empty; |
277 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); | 287 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); |
@@ -315,6 +325,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
315 | protected Vector3 m_lastAcceleration; | 325 | protected Vector3 m_lastAcceleration; |
316 | protected Vector3 m_lastAngularVelocity; | 326 | protected Vector3 m_lastAngularVelocity; |
317 | protected int m_lastTerseSent; | 327 | protected int m_lastTerseSent; |
328 | protected float m_buoyancy = 0.0f; | ||
318 | 329 | ||
319 | /// <summary> | 330 | /// <summary> |
320 | /// Stores media texture data | 331 | /// Stores media texture data |
@@ -367,7 +378,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
367 | UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, | 378 | UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, |
368 | Quaternion rotationOffset, Vector3 offsetPosition) | 379 | Quaternion rotationOffset, Vector3 offsetPosition) |
369 | { | 380 | { |
370 | m_name = "Primitive"; | 381 | m_name = "Object"; |
371 | 382 | ||
372 | Rezzed = DateTime.UtcNow; | 383 | Rezzed = DateTime.UtcNow; |
373 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); | 384 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); |
@@ -422,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
422 | private uint _ownerMask = (uint)PermissionMask.All; | 433 | private uint _ownerMask = (uint)PermissionMask.All; |
423 | private uint _groupMask = (uint)PermissionMask.None; | 434 | private uint _groupMask = (uint)PermissionMask.None; |
424 | private uint _everyoneMask = (uint)PermissionMask.None; | 435 | private uint _everyoneMask = (uint)PermissionMask.None; |
425 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 436 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); |
426 | private PrimFlags _flags = PrimFlags.None; | 437 | private PrimFlags _flags = PrimFlags.None; |
427 | private DateTime m_expires; | 438 | private DateTime m_expires; |
428 | private DateTime m_rezzed; | 439 | private DateTime m_rezzed; |
@@ -521,12 +532,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
521 | } | 532 | } |
522 | 533 | ||
523 | /// <value> | 534 | /// <value> |
524 | /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes | 535 | /// Get the inventory list |
525 | /// </value> | 536 | /// </value> |
526 | public TaskInventoryDictionary TaskInventory | 537 | public TaskInventoryDictionary TaskInventory |
527 | { | 538 | { |
528 | get { return m_inventory.Items; } | 539 | get { |
529 | set { m_inventory.Items = value; } | 540 | return m_inventory.Items; |
541 | } | ||
542 | set { | ||
543 | m_inventory.Items = value; | ||
544 | } | ||
530 | } | 545 | } |
531 | 546 | ||
532 | /// <summary> | 547 | /// <summary> |
@@ -667,14 +682,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
667 | set { m_LoopSoundSlavePrims = value; } | 682 | set { m_LoopSoundSlavePrims = value; } |
668 | } | 683 | } |
669 | 684 | ||
670 | |||
671 | public Byte[] TextureAnimation | 685 | public Byte[] TextureAnimation |
672 | { | 686 | { |
673 | get { return m_TextureAnimation; } | 687 | get { return m_TextureAnimation; } |
674 | set { m_TextureAnimation = value; } | 688 | set { m_TextureAnimation = value; } |
675 | } | 689 | } |
676 | 690 | ||
677 | |||
678 | public Byte[] ParticleSystem | 691 | public Byte[] ParticleSystem |
679 | { | 692 | { |
680 | get { return m_particleSystem; } | 693 | get { return m_particleSystem; } |
@@ -711,9 +724,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
711 | { | 724 | { |
712 | // If this is a linkset, we don't want the physics engine mucking up our group position here. | 725 | // If this is a linkset, we don't want the physics engine mucking up our group position here. |
713 | PhysicsActor actor = PhysActor; | 726 | PhysicsActor actor = PhysActor; |
714 | if (actor != null && _parentID == 0) | 727 | if (_parentID == 0) |
715 | { | 728 | { |
716 | m_groupPosition = actor.Position; | 729 | if (actor != null) |
730 | m_groupPosition = actor.Position; | ||
731 | return m_groupPosition; | ||
717 | } | 732 | } |
718 | 733 | ||
719 | if (m_parentGroup.IsAttachment) | 734 | if (m_parentGroup.IsAttachment) |
@@ -723,12 +738,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
723 | return sp.AbsolutePosition; | 738 | return sp.AbsolutePosition; |
724 | } | 739 | } |
725 | 740 | ||
741 | // use root prim's group position. Physics may have updated it | ||
742 | if (ParentGroup.RootPart != this) | ||
743 | m_groupPosition = ParentGroup.RootPart.GroupPosition; | ||
726 | return m_groupPosition; | 744 | return m_groupPosition; |
727 | } | 745 | } |
728 | set | 746 | set |
729 | { | 747 | { |
730 | m_groupPosition = value; | 748 | m_groupPosition = value; |
731 | |||
732 | PhysicsActor actor = PhysActor; | 749 | PhysicsActor actor = PhysActor; |
733 | if (actor != null) | 750 | if (actor != null) |
734 | { | 751 | { |
@@ -748,22 +765,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
748 | 765 | ||
749 | // Tell the physics engines that this prim changed. | 766 | // Tell the physics engines that this prim changed. |
750 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 767 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
768 | |||
751 | } | 769 | } |
752 | catch (Exception e) | 770 | catch (Exception e) |
753 | { | 771 | { |
754 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); | 772 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); |
755 | } | 773 | } |
756 | } | 774 | } |
757 | |||
758 | // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too | ||
759 | if (m_sitTargetAvatar != UUID.Zero) | ||
760 | { | ||
761 | ScenePresence avatar; | ||
762 | if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar)) | ||
763 | { | ||
764 | avatar.ParentPosition = GetWorldPosition(); | ||
765 | } | ||
766 | } | ||
767 | } | 775 | } |
768 | } | 776 | } |
769 | 777 | ||
@@ -772,7 +780,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
772 | get { return m_offsetPosition; } | 780 | get { return m_offsetPosition; } |
773 | set | 781 | set |
774 | { | 782 | { |
775 | // StoreUndoState(); | 783 | Vector3 oldpos = m_offsetPosition; |
776 | m_offsetPosition = value; | 784 | m_offsetPosition = value; |
777 | 785 | ||
778 | if (ParentGroup != null && !ParentGroup.IsDeleted) | 786 | if (ParentGroup != null && !ParentGroup.IsDeleted) |
@@ -787,7 +795,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
787 | if (m_parentGroup.Scene != null) | 795 | if (m_parentGroup.Scene != null) |
788 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 796 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
789 | } | 797 | } |
798 | |||
799 | if (!m_parentGroup.m_dupeInProgress) | ||
800 | { | ||
801 | List<ScenePresence> avs = ParentGroup.GetLinkedAvatars(); | ||
802 | foreach (ScenePresence av in avs) | ||
803 | { | ||
804 | if (av.LinkedPrim == m_uuid) | ||
805 | { | ||
806 | Vector3 offset = (m_offsetPosition - oldpos); | ||
807 | av.AbsolutePosition += offset; | ||
808 | av.SendAvatarDataToAllAgents(); | ||
809 | } | ||
810 | } | ||
811 | } | ||
790 | } | 812 | } |
813 | TriggerScriptChangedEvent(Changed.POSITION); | ||
791 | } | 814 | } |
792 | } | 815 | } |
793 | 816 | ||
@@ -914,7 +937,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
914 | /// <summary></summary> | 937 | /// <summary></summary> |
915 | public Vector3 Acceleration | 938 | public Vector3 Acceleration |
916 | { | 939 | { |
917 | get { return m_acceleration; } | 940 | get |
941 | { | ||
942 | PhysicsActor actor = PhysActor; | ||
943 | if (actor != null) | ||
944 | { | ||
945 | m_acceleration = actor.Acceleration; | ||
946 | } | ||
947 | return m_acceleration; | ||
948 | } | ||
949 | |||
918 | set { m_acceleration = value; } | 950 | set { m_acceleration = value; } |
919 | } | 951 | } |
920 | 952 | ||
@@ -1245,6 +1277,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1245 | _flags = value; | 1277 | _flags = value; |
1246 | } | 1278 | } |
1247 | } | 1279 | } |
1280 | |||
1281 | [XmlIgnore] | ||
1282 | public bool IsOccupied // KF If an av is sittingon this prim | ||
1283 | { | ||
1284 | get { return m_occupied; } | ||
1285 | set { m_occupied = value; } | ||
1286 | } | ||
1248 | 1287 | ||
1249 | 1288 | ||
1250 | public UUID SitTargetAvatar | 1289 | public UUID SitTargetAvatar |
@@ -1303,6 +1342,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1303 | set { m_collisionSoundVolume = value; } | 1342 | set { m_collisionSoundVolume = value; } |
1304 | } | 1343 | } |
1305 | 1344 | ||
1345 | public float Buoyancy | ||
1346 | { | ||
1347 | get { return m_buoyancy; } | ||
1348 | set | ||
1349 | { | ||
1350 | m_buoyancy = value; | ||
1351 | if (PhysActor != null) | ||
1352 | { | ||
1353 | PhysActor.Buoyancy = value; | ||
1354 | } | ||
1355 | } | ||
1356 | } | ||
1357 | |||
1306 | #endregion Public Properties with only Get | 1358 | #endregion Public Properties with only Get |
1307 | 1359 | ||
1308 | private uint ApplyMask(uint val, bool set, uint mask) | 1360 | private uint ApplyMask(uint val, bool set, uint mask) |
@@ -1675,6 +1727,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1675 | 1727 | ||
1676 | // Move afterwards ResetIDs as it clears the localID | 1728 | // Move afterwards ResetIDs as it clears the localID |
1677 | dupe.LocalId = localID; | 1729 | dupe.LocalId = localID; |
1730 | if(dupe.PhysActor != null) | ||
1731 | dupe.PhysActor.LocalID = localID; | ||
1732 | |||
1678 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. | 1733 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. |
1679 | dupe._lastOwnerID = OwnerID; | 1734 | dupe._lastOwnerID = OwnerID; |
1680 | 1735 | ||
@@ -2041,19 +2096,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2041 | public Vector3 GetWorldPosition() | 2096 | public Vector3 GetWorldPosition() |
2042 | { | 2097 | { |
2043 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; | 2098 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; |
2044 | |||
2045 | Vector3 axPos = OffsetPosition; | 2099 | Vector3 axPos = OffsetPosition; |
2046 | |||
2047 | axPos *= parentRot; | 2100 | axPos *= parentRot; |
2048 | Vector3 translationOffsetPosition = axPos; | 2101 | Vector3 translationOffsetPosition = axPos; |
2049 | 2102 | if(_parentID == 0) | |
2050 | // m_log.DebugFormat("[SCENE OBJECT PART]: Found group pos {0} for part {1}", GroupPosition, Name); | 2103 | { |
2051 | 2104 | return GroupPosition; | |
2052 | Vector3 worldPos = GroupPosition + translationOffsetPosition; | 2105 | } |
2053 | 2106 | else | |
2054 | // m_log.DebugFormat("[SCENE OBJECT PART]: Found world pos {0} for part {1}", worldPos, Name); | 2107 | { |
2055 | 2108 | return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position | |
2056 | return worldPos; | 2109 | } |
2057 | } | 2110 | } |
2058 | 2111 | ||
2059 | /// <summary> | 2112 | /// <summary> |
@@ -2693,17 +2746,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2693 | //Trys to fetch sound id from prim's inventory. | 2746 | //Trys to fetch sound id from prim's inventory. |
2694 | //Prim's inventory doesn't support non script items yet | 2747 | //Prim's inventory doesn't support non script items yet |
2695 | 2748 | ||
2696 | lock (TaskInventory) | 2749 | TaskInventory.LockItemsForRead(true); |
2750 | |||
2751 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
2697 | { | 2752 | { |
2698 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | 2753 | if (item.Value.Name == sound) |
2699 | { | 2754 | { |
2700 | if (item.Value.Name == sound) | 2755 | soundID = item.Value.ItemID; |
2701 | { | 2756 | break; |
2702 | soundID = item.Value.ItemID; | ||
2703 | break; | ||
2704 | } | ||
2705 | } | 2757 | } |
2706 | } | 2758 | } |
2759 | |||
2760 | TaskInventory.LockItemsForRead(false); | ||
2707 | } | 2761 | } |
2708 | 2762 | ||
2709 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) | 2763 | m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp) |
@@ -2788,7 +2842,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2788 | 2842 | ||
2789 | public void RotLookAt(Quaternion target, float strength, float damping) | 2843 | public void RotLookAt(Quaternion target, float strength, float damping) |
2790 | { | 2844 | { |
2791 | rotLookAt(target, strength, damping); | 2845 | m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup. |
2792 | } | 2846 | } |
2793 | 2847 | ||
2794 | public void rotLookAt(Quaternion target, float strength, float damping) | 2848 | public void rotLookAt(Quaternion target, float strength, float damping) |
@@ -3034,8 +3088,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3034 | { | 3088 | { |
3035 | const float ROTATION_TOLERANCE = 0.01f; | 3089 | const float ROTATION_TOLERANCE = 0.01f; |
3036 | const float VELOCITY_TOLERANCE = 0.001f; | 3090 | const float VELOCITY_TOLERANCE = 0.001f; |
3037 | const float POSITION_TOLERANCE = 0.05f; | 3091 | const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary |
3038 | const int TIME_MS_TOLERANCE = 3000; | 3092 | const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds. |
3039 | 3093 | ||
3040 | if (m_updateFlag == 1) | 3094 | if (m_updateFlag == 1) |
3041 | { | 3095 | { |
@@ -3049,7 +3103,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3049 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | 3103 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
3050 | { | 3104 | { |
3051 | AddTerseUpdateToAllAvatars(); | 3105 | AddTerseUpdateToAllAvatars(); |
3052 | ClearUpdateSchedule(); | 3106 | |
3053 | 3107 | ||
3054 | // This causes the Scene to 'poll' physical objects every couple of frames | 3108 | // This causes the Scene to 'poll' physical objects every couple of frames |
3055 | // bad, so it's been replaced by an event driven method. | 3109 | // bad, so it's been replaced by an event driven method. |
@@ -3067,16 +3121,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3067 | m_lastAngularVelocity = AngularVelocity; | 3121 | m_lastAngularVelocity = AngularVelocity; |
3068 | m_lastTerseSent = Environment.TickCount; | 3122 | m_lastTerseSent = Environment.TickCount; |
3069 | } | 3123 | } |
3124 | //Moved this outside of the if clause so updates don't get blocked.. *sigh* | ||
3125 | m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams* | ||
3070 | } | 3126 | } |
3071 | else | 3127 | else |
3072 | { | 3128 | { |
3073 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | 3129 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes |
3074 | { | 3130 | { |
3075 | AddFullUpdateToAllAvatars(); | 3131 | AddFullUpdateToAllAvatars(); |
3076 | ClearUpdateSchedule(); | 3132 | m_updateFlag = 0; //Same here |
3077 | } | 3133 | } |
3078 | } | 3134 | } |
3079 | ClearUpdateSchedule(); | 3135 | m_updateFlag = 0; |
3080 | } | 3136 | } |
3081 | 3137 | ||
3082 | /// <summary> | 3138 | /// <summary> |
@@ -3104,17 +3160,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3104 | if (!UUID.TryParse(sound, out soundID)) | 3160 | if (!UUID.TryParse(sound, out soundID)) |
3105 | { | 3161 | { |
3106 | // search sound file from inventory | 3162 | // search sound file from inventory |
3107 | lock (TaskInventory) | 3163 | TaskInventory.LockItemsForRead(true); |
3164 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
3108 | { | 3165 | { |
3109 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | 3166 | if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) |
3110 | { | 3167 | { |
3111 | if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) | 3168 | soundID = item.Value.ItemID; |
3112 | { | 3169 | break; |
3113 | soundID = item.Value.ItemID; | ||
3114 | break; | ||
3115 | } | ||
3116 | } | 3170 | } |
3117 | } | 3171 | } |
3172 | TaskInventory.LockItemsForRead(false); | ||
3118 | } | 3173 | } |
3119 | 3174 | ||
3120 | if (soundID == UUID.Zero) | 3175 | if (soundID == UUID.Zero) |
@@ -3525,7 +3580,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3525 | 3580 | ||
3526 | public void StopLookAt() | 3581 | public void StopLookAt() |
3527 | { | 3582 | { |
3528 | m_parentGroup.stopLookAt(); | 3583 | m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup. |
3529 | 3584 | ||
3530 | m_parentGroup.ScheduleGroupForTerseUpdate(); | 3585 | m_parentGroup.ScheduleGroupForTerseUpdate(); |
3531 | } | 3586 | } |
@@ -3576,45 +3631,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
3576 | // TODO: May need to fix for group comparison | 3631 | // TODO: May need to fix for group comparison |
3577 | if (last.Compare(this)) | 3632 | if (last.Compare(this)) |
3578 | { | 3633 | { |
3579 | // m_log.DebugFormat( | 3634 | // m_log.DebugFormat( |
3580 | // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", | 3635 | // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", |
3581 | // Name, LocalId, m_undo.Count); | 3636 | // Name, LocalId, m_undo.Count); |
3582 | 3637 | ||
3583 | return; | 3638 | return; |
3584 | } | 3639 | } |
3585 | } | 3640 | } |
3586 | } | 3641 | } |
3587 | 3642 | ||
3588 | // m_log.DebugFormat( | 3643 | // m_log.DebugFormat( |
3589 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", | 3644 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", |
3590 | // Name, LocalId, forGroup, m_undo.Count); | 3645 | // Name, LocalId, forGroup, m_undo.Count); |
3591 | 3646 | ||
3592 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3647 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
3593 | { | 3648 | { |
3594 | UndoState nUndo = new UndoState(this, forGroup); | 3649 | UndoState nUndo = new UndoState(this, forGroup); |
3595 | 3650 | ||
3596 | m_undo.Push(nUndo); | 3651 | m_undo.Push(nUndo); |
3597 | 3652 | ||
3598 | if (m_redo.Count > 0) | 3653 | if (m_redo.Count > 0) |
3599 | m_redo.Clear(); | 3654 | m_redo.Clear(); |
3600 | 3655 | ||
3601 | // m_log.DebugFormat( | 3656 | // m_log.DebugFormat( |
3602 | // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", | 3657 | // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", |
3603 | // Name, LocalId, forGroup, m_undo.Count); | 3658 | // Name, LocalId, forGroup, m_undo.Count); |
3604 | } | 3659 | } |
3605 | } | 3660 | } |
3606 | } | 3661 | } |
3607 | } | 3662 | } |
3608 | // else | 3663 | // else |
3609 | // { | 3664 | // { |
3610 | // m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); | 3665 | // m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); |
3611 | // } | 3666 | // } |
3612 | } | 3667 | } |
3613 | // else | 3668 | // else |
3614 | // { | 3669 | // { |
3615 | // m_log.DebugFormat( | 3670 | // m_log.DebugFormat( |
3616 | // "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); | 3671 | // "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); |
3617 | // } | 3672 | // } |
3618 | } | 3673 | } |
3619 | 3674 | ||
3620 | /// <summary> | 3675 | /// <summary> |
@@ -4661,8 +4716,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4661 | { | 4716 | { |
4662 | m_shape.TextureEntry = textureEntry; | 4717 | m_shape.TextureEntry = textureEntry; |
4663 | TriggerScriptChangedEvent(Changed.TEXTURE); | 4718 | TriggerScriptChangedEvent(Changed.TEXTURE); |
4664 | 4719 | m_updateFlag = 1; | |
4665 | ParentGroup.HasGroupChanged = true; | 4720 | ParentGroup.HasGroupChanged = true; |
4721 | |||
4666 | //This is madness.. | 4722 | //This is madness.. |
4667 | //ParentGroup.ScheduleGroupForFullUpdate(); | 4723 | //ParentGroup.ScheduleGroupForFullUpdate(); |
4668 | //This is sparta | 4724 | //This is sparta |
@@ -4859,5 +4915,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
4859 | Color color = Color; | 4915 | Color color = Color; |
4860 | return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A)); | 4916 | return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A)); |
4861 | } | 4917 | } |
4918 | |||
4919 | public void ResetOwnerChangeFlag() | ||
4920 | { | ||
4921 | List<UUID> inv = Inventory.GetInventoryList(); | ||
4922 | |||
4923 | foreach (UUID itemID in inv) | ||
4924 | { | ||
4925 | TaskInventoryItem item = Inventory.GetInventoryItem(itemID); | ||
4926 | item.OwnerChanged = false; | ||
4927 | Inventory.UpdateInventoryItem(item, false, false); | ||
4928 | } | ||
4929 | } | ||
4862 | } | 4930 | } |
4863 | } | 4931 | } |