diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 227 |
1 files changed, 148 insertions, 79 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b68cc9f..a2e13ce 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. |
@@ -177,6 +178,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
177 | 178 | ||
178 | public UUID FromFolderID; | 179 | public UUID FromFolderID; |
179 | 180 | ||
181 | // The following two are to hold the attachment data | ||
182 | // while an object is inworld | ||
183 | [XmlIgnore] | ||
184 | public byte AttachPoint = 0; | ||
185 | |||
186 | [XmlIgnore] | ||
187 | public Vector3 AttachOffset = Vector3.Zero; | ||
188 | |||
189 | [XmlIgnore] | ||
180 | public int STATUS_ROTATE_X; | 190 | public int STATUS_ROTATE_X; |
181 | 191 | ||
182 | public int STATUS_ROTATE_Y; | 192 | public int STATUS_ROTATE_Y; |
@@ -246,6 +256,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
246 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; | 256 | private Quaternion m_sitTargetOrientation = Quaternion.Identity; |
247 | private Vector3 m_sitTargetPosition; | 257 | private Vector3 m_sitTargetPosition; |
248 | private string m_sitAnimation = "SIT"; | 258 | private string m_sitAnimation = "SIT"; |
259 | private bool m_occupied; // KF if any av is sitting on this prim | ||
249 | private string m_text = String.Empty; | 260 | private string m_text = String.Empty; |
250 | private string m_touchName = String.Empty; | 261 | private string m_touchName = String.Empty; |
251 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); | 262 | private readonly Stack<UndoState> m_undo = new Stack<UndoState>(5); |
@@ -289,6 +300,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
289 | protected Vector3 m_lastAcceleration; | 300 | protected Vector3 m_lastAcceleration; |
290 | protected Vector3 m_lastAngularVelocity; | 301 | protected Vector3 m_lastAngularVelocity; |
291 | protected int m_lastTerseSent; | 302 | protected int m_lastTerseSent; |
303 | protected float m_buoyancy = 0.0f; | ||
292 | 304 | ||
293 | /// <summary> | 305 | /// <summary> |
294 | /// Stores media texture data | 306 | /// Stores media texture data |
@@ -341,7 +353,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
341 | UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, | 353 | UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, |
342 | Quaternion rotationOffset, Vector3 offsetPosition) | 354 | Quaternion rotationOffset, Vector3 offsetPosition) |
343 | { | 355 | { |
344 | m_name = "Primitive"; | 356 | m_name = "Object"; |
345 | 357 | ||
346 | Rezzed = DateTime.UtcNow; | 358 | Rezzed = DateTime.UtcNow; |
347 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); | 359 | _creationDate = (int)Utils.DateTimeToUnixTime(Rezzed); |
@@ -396,7 +408,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
396 | private uint _ownerMask = (uint)PermissionMask.All; | 408 | private uint _ownerMask = (uint)PermissionMask.All; |
397 | private uint _groupMask = (uint)PermissionMask.None; | 409 | private uint _groupMask = (uint)PermissionMask.None; |
398 | private uint _everyoneMask = (uint)PermissionMask.None; | 410 | private uint _everyoneMask = (uint)PermissionMask.None; |
399 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 411 | private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); |
400 | private PrimFlags _flags = PrimFlags.None; | 412 | private PrimFlags _flags = PrimFlags.None; |
401 | private DateTime m_expires; | 413 | private DateTime m_expires; |
402 | private DateTime m_rezzed; | 414 | private DateTime m_rezzed; |
@@ -495,12 +507,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
495 | } | 507 | } |
496 | 508 | ||
497 | /// <value> | 509 | /// <value> |
498 | /// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes | 510 | /// Get the inventory list |
499 | /// </value> | 511 | /// </value> |
500 | public TaskInventoryDictionary TaskInventory | 512 | public TaskInventoryDictionary TaskInventory |
501 | { | 513 | { |
502 | get { return m_inventory.Items; } | 514 | get { |
503 | set { m_inventory.Items = value; } | 515 | return m_inventory.Items; |
516 | } | ||
517 | set { | ||
518 | m_inventory.Items = value; | ||
519 | } | ||
504 | } | 520 | } |
505 | 521 | ||
506 | /// <summary> | 522 | /// <summary> |
@@ -641,14 +657,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
641 | set { m_LoopSoundSlavePrims = value; } | 657 | set { m_LoopSoundSlavePrims = value; } |
642 | } | 658 | } |
643 | 659 | ||
644 | |||
645 | public Byte[] TextureAnimation | 660 | public Byte[] TextureAnimation |
646 | { | 661 | { |
647 | get { return m_TextureAnimation; } | 662 | get { return m_TextureAnimation; } |
648 | set { m_TextureAnimation = value; } | 663 | set { m_TextureAnimation = value; } |
649 | } | 664 | } |
650 | 665 | ||
651 | |||
652 | public Byte[] ParticleSystem | 666 | public Byte[] ParticleSystem |
653 | { | 667 | { |
654 | get { return m_particleSystem; } | 668 | get { return m_particleSystem; } |
@@ -685,9 +699,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
685 | { | 699 | { |
686 | // If this is a linkset, we don't want the physics engine mucking up our group position here. | 700 | // If this is a linkset, we don't want the physics engine mucking up our group position here. |
687 | PhysicsActor actor = PhysActor; | 701 | PhysicsActor actor = PhysActor; |
688 | if (actor != null && _parentID == 0) | 702 | if (_parentID == 0) |
689 | { | 703 | { |
690 | m_groupPosition = actor.Position; | 704 | if (actor != null) |
705 | m_groupPosition = actor.Position; | ||
706 | return m_groupPosition; | ||
691 | } | 707 | } |
692 | 708 | ||
693 | if (m_parentGroup.IsAttachment) | 709 | if (m_parentGroup.IsAttachment) |
@@ -697,12 +713,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
697 | return sp.AbsolutePosition; | 713 | return sp.AbsolutePosition; |
698 | } | 714 | } |
699 | 715 | ||
716 | // use root prim's group position. Physics may have updated it | ||
717 | if (ParentGroup.RootPart != this) | ||
718 | m_groupPosition = ParentGroup.RootPart.GroupPosition; | ||
700 | return m_groupPosition; | 719 | return m_groupPosition; |
701 | } | 720 | } |
702 | set | 721 | set |
703 | { | 722 | { |
704 | m_groupPosition = value; | 723 | m_groupPosition = value; |
705 | |||
706 | PhysicsActor actor = PhysActor; | 724 | PhysicsActor actor = PhysActor; |
707 | if (actor != null) | 725 | if (actor != null) |
708 | { | 726 | { |
@@ -722,22 +740,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
722 | 740 | ||
723 | // Tell the physics engines that this prim changed. | 741 | // Tell the physics engines that this prim changed. |
724 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 742 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
743 | |||
725 | } | 744 | } |
726 | catch (Exception e) | 745 | catch (Exception e) |
727 | { | 746 | { |
728 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); | 747 | m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); |
729 | } | 748 | } |
730 | } | 749 | } |
731 | |||
732 | // TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too | ||
733 | if (m_sitTargetAvatar != UUID.Zero) | ||
734 | { | ||
735 | ScenePresence avatar; | ||
736 | if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar)) | ||
737 | { | ||
738 | avatar.ParentPosition = GetWorldPosition(); | ||
739 | } | ||
740 | } | ||
741 | } | 750 | } |
742 | } | 751 | } |
743 | 752 | ||
@@ -746,7 +755,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
746 | get { return m_offsetPosition; } | 755 | get { return m_offsetPosition; } |
747 | set | 756 | set |
748 | { | 757 | { |
749 | // StoreUndoState(); | 758 | Vector3 oldpos = m_offsetPosition; |
750 | m_offsetPosition = value; | 759 | m_offsetPosition = value; |
751 | 760 | ||
752 | if (ParentGroup != null && !ParentGroup.IsDeleted) | 761 | if (ParentGroup != null && !ParentGroup.IsDeleted) |
@@ -761,7 +770,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
761 | if (m_parentGroup.Scene != null) | 770 | if (m_parentGroup.Scene != null) |
762 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); | 771 | m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); |
763 | } | 772 | } |
773 | |||
774 | if (!m_parentGroup.m_dupeInProgress) | ||
775 | { | ||
776 | List<ScenePresence> avs = ParentGroup.GetLinkedAvatars(); | ||
777 | foreach (ScenePresence av in avs) | ||
778 | { | ||
779 | if (av.ParentID == m_localId) | ||
780 | { | ||
781 | Vector3 offset = (m_offsetPosition - oldpos); | ||
782 | av.AbsolutePosition += offset; | ||
783 | av.SendAvatarDataToAllAgents(); | ||
784 | } | ||
785 | } | ||
786 | } | ||
764 | } | 787 | } |
788 | TriggerScriptChangedEvent(Changed.POSITION); | ||
765 | } | 789 | } |
766 | } | 790 | } |
767 | 791 | ||
@@ -902,7 +926,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
902 | /// <summary></summary> | 926 | /// <summary></summary> |
903 | public Vector3 Acceleration | 927 | public Vector3 Acceleration |
904 | { | 928 | { |
905 | get { return m_acceleration; } | 929 | get |
930 | { | ||
931 | PhysicsActor actor = PhysActor; | ||
932 | if (actor != null) | ||
933 | { | ||
934 | m_acceleration = actor.Acceleration; | ||
935 | } | ||
936 | return m_acceleration; | ||
937 | } | ||
938 | |||
906 | set { m_acceleration = value; } | 939 | set { m_acceleration = value; } |
907 | } | 940 | } |
908 | 941 | ||
@@ -1233,6 +1266,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1233 | _flags = value; | 1266 | _flags = value; |
1234 | } | 1267 | } |
1235 | } | 1268 | } |
1269 | |||
1270 | [XmlIgnore] | ||
1271 | public bool IsOccupied // KF If an av is sittingon this prim | ||
1272 | { | ||
1273 | get { return m_occupied; } | ||
1274 | set { m_occupied = value; } | ||
1275 | } | ||
1236 | 1276 | ||
1237 | /// <summary> | 1277 | /// <summary> |
1238 | /// ID of the avatar that is sat on us. If there is no such avatar then is UUID.Zero | 1278 | /// ID of the avatar that is sat on us. If there is no such avatar then is UUID.Zero |
@@ -1292,6 +1332,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1292 | set { m_collisionSoundVolume = value; } | 1332 | set { m_collisionSoundVolume = value; } |
1293 | } | 1333 | } |
1294 | 1334 | ||
1335 | public float Buoyancy | ||
1336 | { | ||
1337 | get { return m_buoyancy; } | ||
1338 | set | ||
1339 | { | ||
1340 | m_buoyancy = value; | ||
1341 | if (PhysActor != null) | ||
1342 | { | ||
1343 | PhysActor.Buoyancy = value; | ||
1344 | } | ||
1345 | } | ||
1346 | } | ||
1347 | |||
1295 | #endregion Public Properties with only Get | 1348 | #endregion Public Properties with only Get |
1296 | 1349 | ||
1297 | private uint ApplyMask(uint val, bool set, uint mask) | 1350 | private uint ApplyMask(uint val, bool set, uint mask) |
@@ -1663,6 +1716,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1663 | 1716 | ||
1664 | // Move afterwards ResetIDs as it clears the localID | 1717 | // Move afterwards ResetIDs as it clears the localID |
1665 | dupe.LocalId = localID; | 1718 | dupe.LocalId = localID; |
1719 | if(dupe.PhysActor != null) | ||
1720 | dupe.PhysActor.LocalID = localID; | ||
1721 | |||
1666 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. | 1722 | // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. |
1667 | dupe._lastOwnerID = OwnerID; | 1723 | dupe._lastOwnerID = OwnerID; |
1668 | 1724 | ||
@@ -2024,19 +2080,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2024 | public Vector3 GetWorldPosition() | 2080 | public Vector3 GetWorldPosition() |
2025 | { | 2081 | { |
2026 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; | 2082 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; |
2027 | |||
2028 | Vector3 axPos = OffsetPosition; | 2083 | Vector3 axPos = OffsetPosition; |
2029 | |||
2030 | axPos *= parentRot; | 2084 | axPos *= parentRot; |
2031 | Vector3 translationOffsetPosition = axPos; | 2085 | Vector3 translationOffsetPosition = axPos; |
2032 | 2086 | if(_parentID == 0) | |
2033 | // m_log.DebugFormat("[SCENE OBJECT PART]: Found group pos {0} for part {1}", GroupPosition, Name); | 2087 | { |
2034 | 2088 | return GroupPosition; | |
2035 | Vector3 worldPos = GroupPosition + translationOffsetPosition; | 2089 | } |
2036 | 2090 | else | |
2037 | // m_log.DebugFormat("[SCENE OBJECT PART]: Found world pos {0} for part {1}", worldPos, Name); | 2091 | { |
2038 | 2092 | return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position | |
2039 | return worldPos; | 2093 | } |
2040 | } | 2094 | } |
2041 | 2095 | ||
2042 | /// <summary> | 2096 | /// <summary> |
@@ -2676,17 +2730,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2676 | //Trys to fetch sound id from prim's inventory. | 2730 | //Trys to fetch sound id from prim's inventory. |
2677 | //Prim's inventory doesn't support non script items yet | 2731 | //Prim's inventory doesn't support non script items yet |
2678 | 2732 | ||
2679 | lock (TaskInventory) | 2733 | TaskInventory.LockItemsForRead(true); |
2734 | |||
2735 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
2680 | { | 2736 | { |
2681 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | 2737 | if (item.Value.Name == sound) |
2682 | { | 2738 | { |
2683 | if (item.Value.Name == sound) | 2739 | soundID = item.Value.ItemID; |
2684 | { | 2740 | break; |
2685 | soundID = item.Value.ItemID; | ||
2686 | break; | ||
2687 | } | ||
2688 | } | 2741 | } |
2689 | } | 2742 | } |
2743 | |||
2744 | TaskInventory.LockItemsForRead(false); | ||
2690 | } | 2745 | } |
2691 | 2746 | ||
2692 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) | 2747 | m_parentGroup.Scene.ForEachRootScenePresence(delegate(ScenePresence sp) |
@@ -2769,7 +2824,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2769 | 2824 | ||
2770 | public void RotLookAt(Quaternion target, float strength, float damping) | 2825 | public void RotLookAt(Quaternion target, float strength, float damping) |
2771 | { | 2826 | { |
2772 | rotLookAt(target, strength, damping); | 2827 | m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup. |
2773 | } | 2828 | } |
2774 | 2829 | ||
2775 | public void rotLookAt(Quaternion target, float strength, float damping) | 2830 | public void rotLookAt(Quaternion target, float strength, float damping) |
@@ -3015,8 +3070,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3015 | { | 3070 | { |
3016 | const float ROTATION_TOLERANCE = 0.01f; | 3071 | const float ROTATION_TOLERANCE = 0.01f; |
3017 | const float VELOCITY_TOLERANCE = 0.001f; | 3072 | const float VELOCITY_TOLERANCE = 0.001f; |
3018 | const float POSITION_TOLERANCE = 0.05f; | 3073 | const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary |
3019 | const int TIME_MS_TOLERANCE = 3000; | 3074 | const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds. |
3020 | 3075 | ||
3021 | if (m_updateFlag == 1) | 3076 | if (m_updateFlag == 1) |
3022 | { | 3077 | { |
@@ -3030,7 +3085,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3030 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | 3085 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
3031 | { | 3086 | { |
3032 | AddTerseUpdateToAllAvatars(); | 3087 | AddTerseUpdateToAllAvatars(); |
3033 | ClearUpdateSchedule(); | 3088 | |
3034 | 3089 | ||
3035 | // This causes the Scene to 'poll' physical objects every couple of frames | 3090 | // This causes the Scene to 'poll' physical objects every couple of frames |
3036 | // bad, so it's been replaced by an event driven method. | 3091 | // bad, so it's been replaced by an event driven method. |
@@ -3048,16 +3103,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3048 | m_lastAngularVelocity = AngularVelocity; | 3103 | m_lastAngularVelocity = AngularVelocity; |
3049 | m_lastTerseSent = Environment.TickCount; | 3104 | m_lastTerseSent = Environment.TickCount; |
3050 | } | 3105 | } |
3106 | //Moved this outside of the if clause so updates don't get blocked.. *sigh* | ||
3107 | m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams* | ||
3051 | } | 3108 | } |
3052 | else | 3109 | else |
3053 | { | 3110 | { |
3054 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes | 3111 | if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes |
3055 | { | 3112 | { |
3056 | AddFullUpdateToAllAvatars(); | 3113 | AddFullUpdateToAllAvatars(); |
3057 | ClearUpdateSchedule(); | 3114 | m_updateFlag = 0; //Same here |
3058 | } | 3115 | } |
3059 | } | 3116 | } |
3060 | ClearUpdateSchedule(); | 3117 | m_updateFlag = 0; |
3061 | } | 3118 | } |
3062 | 3119 | ||
3063 | /// <summary> | 3120 | /// <summary> |
@@ -3085,17 +3142,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3085 | if (!UUID.TryParse(sound, out soundID)) | 3142 | if (!UUID.TryParse(sound, out soundID)) |
3086 | { | 3143 | { |
3087 | // search sound file from inventory | 3144 | // search sound file from inventory |
3088 | lock (TaskInventory) | 3145 | TaskInventory.LockItemsForRead(true); |
3146 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | ||
3089 | { | 3147 | { |
3090 | foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory) | 3148 | if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) |
3091 | { | 3149 | { |
3092 | if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound) | 3150 | soundID = item.Value.ItemID; |
3093 | { | 3151 | break; |
3094 | soundID = item.Value.ItemID; | ||
3095 | break; | ||
3096 | } | ||
3097 | } | 3152 | } |
3098 | } | 3153 | } |
3154 | TaskInventory.LockItemsForRead(false); | ||
3099 | } | 3155 | } |
3100 | 3156 | ||
3101 | if (soundID == UUID.Zero) | 3157 | if (soundID == UUID.Zero) |
@@ -3506,7 +3562,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3506 | 3562 | ||
3507 | public void StopLookAt() | 3563 | public void StopLookAt() |
3508 | { | 3564 | { |
3509 | m_parentGroup.stopLookAt(); | 3565 | m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup. |
3510 | 3566 | ||
3511 | m_parentGroup.ScheduleGroupForTerseUpdate(); | 3567 | m_parentGroup.ScheduleGroupForTerseUpdate(); |
3512 | } | 3568 | } |
@@ -3557,45 +3613,45 @@ namespace OpenSim.Region.Framework.Scenes | |||
3557 | // TODO: May need to fix for group comparison | 3613 | // TODO: May need to fix for group comparison |
3558 | if (last.Compare(this)) | 3614 | if (last.Compare(this)) |
3559 | { | 3615 | { |
3560 | // m_log.DebugFormat( | 3616 | // m_log.DebugFormat( |
3561 | // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", | 3617 | // "[SCENE OBJECT PART]: Not storing undo for {0} {1} since current state is same as last undo state, initial stack size {2}", |
3562 | // Name, LocalId, m_undo.Count); | 3618 | // Name, LocalId, m_undo.Count); |
3563 | 3619 | ||
3564 | return; | 3620 | return; |
3565 | } | 3621 | } |
3566 | } | 3622 | } |
3567 | } | 3623 | } |
3568 | 3624 | ||
3569 | // m_log.DebugFormat( | 3625 | // m_log.DebugFormat( |
3570 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", | 3626 | // "[SCENE OBJECT PART]: Storing undo state for {0} {1}, forGroup {2}, initial stack size {3}", |
3571 | // Name, LocalId, forGroup, m_undo.Count); | 3627 | // Name, LocalId, forGroup, m_undo.Count); |
3572 | 3628 | ||
3573 | if (m_parentGroup.GetSceneMaxUndo() > 0) | 3629 | if (m_parentGroup.GetSceneMaxUndo() > 0) |
3574 | { | 3630 | { |
3575 | UndoState nUndo = new UndoState(this, forGroup); | 3631 | UndoState nUndo = new UndoState(this, forGroup); |
3576 | 3632 | ||
3577 | m_undo.Push(nUndo); | 3633 | m_undo.Push(nUndo); |
3578 | 3634 | ||
3579 | if (m_redo.Count > 0) | 3635 | if (m_redo.Count > 0) |
3580 | m_redo.Clear(); | 3636 | m_redo.Clear(); |
3581 | 3637 | ||
3582 | // m_log.DebugFormat( | 3638 | // m_log.DebugFormat( |
3583 | // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", | 3639 | // "[SCENE OBJECT PART]: Stored undo state for {0} {1}, forGroup {2}, stack size now {3}", |
3584 | // Name, LocalId, forGroup, m_undo.Count); | 3640 | // Name, LocalId, forGroup, m_undo.Count); |
3585 | } | 3641 | } |
3586 | } | 3642 | } |
3587 | } | 3643 | } |
3588 | } | 3644 | } |
3589 | // else | 3645 | // else |
3590 | // { | 3646 | // { |
3591 | // m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); | 3647 | // m_log.DebugFormat("[SCENE OBJECT PART]: Ignoring undo store for {0} {1}", Name, LocalId); |
3592 | // } | 3648 | // } |
3593 | } | 3649 | } |
3594 | // else | 3650 | // else |
3595 | // { | 3651 | // { |
3596 | // m_log.DebugFormat( | 3652 | // m_log.DebugFormat( |
3597 | // "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); | 3653 | // "[SCENE OBJECT PART]: Ignoring undo store for {0} {1} since already undoing", Name, LocalId); |
3598 | // } | 3654 | // } |
3599 | } | 3655 | } |
3600 | 3656 | ||
3601 | /// <summary> | 3657 | /// <summary> |
@@ -4643,8 +4699,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4643 | { | 4699 | { |
4644 | m_shape.TextureEntry = textureEntry; | 4700 | m_shape.TextureEntry = textureEntry; |
4645 | TriggerScriptChangedEvent(Changed.TEXTURE); | 4701 | TriggerScriptChangedEvent(Changed.TEXTURE); |
4646 | 4702 | m_updateFlag = 1; | |
4647 | ParentGroup.HasGroupChanged = true; | 4703 | ParentGroup.HasGroupChanged = true; |
4704 | |||
4648 | //This is madness.. | 4705 | //This is madness.. |
4649 | //ParentGroup.ScheduleGroupForFullUpdate(); | 4706 | //ParentGroup.ScheduleGroupForFullUpdate(); |
4650 | //This is sparta | 4707 | //This is sparta |
@@ -4841,5 +4898,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
4841 | Color color = Color; | 4898 | Color color = Color; |
4842 | return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A)); | 4899 | return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A)); |
4843 | } | 4900 | } |
4901 | |||
4902 | public void ResetOwnerChangeFlag() | ||
4903 | { | ||
4904 | List<UUID> inv = Inventory.GetInventoryList(); | ||
4905 | |||
4906 | foreach (UUID itemID in inv) | ||
4907 | { | ||
4908 | TaskInventoryItem item = Inventory.GetInventoryItem(itemID); | ||
4909 | item.OwnerChanged = false; | ||
4910 | Inventory.UpdateInventoryItem(item, false, false); | ||
4911 | } | ||
4912 | } | ||
4844 | } | 4913 | } |
4845 | } | 4914 | } |