diff options
author | Justin Clark-Casey (justincc) | 2011-08-26 23:06:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-26 23:06:41 +0100 |
commit | 15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a (patch) | |
tree | 25b452008eb21a6426617c65af866161cf3bcae8 /OpenSim/Region/CoreModules/Avatar | |
parent | refactor: move SOG.DetachToGround() to AttachmentsModule.DetachSceneObjectToG... (diff) | |
download | opensim-SC_OLD-15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a.zip opensim-SC_OLD-15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a.tar.gz opensim-SC_OLD-15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a.tar.bz2 opensim-SC_OLD-15a514fcbc8f7447fc3a5997b6bbc2fe35974c9a.tar.xz |
refactor: simplify SOP.AttachedAvatar into SOG.AttachedAvatar
This does a tiny bit to reduce code complexity, memory requirement and the cpu time of pointlessly setting this field to the same value in every SOP
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 93920b0..3e1cb02 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -456,7 +456,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
456 | if (so == null) | 456 | if (so == null) |
457 | return; | 457 | return; |
458 | 458 | ||
459 | if (so.RootPart.AttachedAvatar != remoteClient.AgentId) | 459 | if (so.AttachedAvatar != remoteClient.AgentId) |
460 | return; | 460 | return; |
461 | 461 | ||
462 | UUID inventoryID = so.GetFromItemID(); | 462 | UUID inventoryID = so.GetFromItemID(); |
@@ -498,7 +498,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
498 | 498 | ||
499 | rootPart.FromItemID = UUID.Zero; | 499 | rootPart.FromItemID = UUID.Zero; |
500 | so.AbsolutePosition = sp.AbsolutePosition; | 500 | so.AbsolutePosition = sp.AbsolutePosition; |
501 | so.ForEachPart(part => part.AttachedAvatar = UUID.Zero); | 501 | so.AttachedAvatar = UUID.Zero; |
502 | rootPart.SetParentLocalId(0); | 502 | rootPart.SetParentLocalId(0); |
503 | so.ClearPartAttachmentData(); | 503 | so.ClearPartAttachmentData(); |
504 | rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive, m_scene.m_physicalPrim); | 504 | rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive, m_scene.m_physicalPrim); |
@@ -534,11 +534,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
534 | sp.RemoveAttachment(group); | 534 | sp.RemoveAttachment(group); |
535 | 535 | ||
536 | // Prepare sog for storage | 536 | // Prepare sog for storage |
537 | group.AttachedAvatar = UUID.Zero; | ||
538 | |||
537 | group.ForEachPart( | 539 | group.ForEachPart( |
538 | delegate(SceneObjectPart part) | 540 | delegate(SceneObjectPart part) |
539 | { | 541 | { |
540 | part.AttachedAvatar = UUID.Zero; | ||
541 | |||
542 | // If there are any scripts, | 542 | // If there are any scripts, |
543 | // then always trigger a new object and state persistence in UpdateKnownItem() | 543 | // then always trigger a new object and state persistence in UpdateKnownItem() |
544 | if (part.Inventory.ContainsScripts()) | 544 | if (part.Inventory.ContainsScripts()) |
@@ -656,12 +656,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
656 | m_scene.DeleteFromStorage(so.UUID); | 656 | m_scene.DeleteFromStorage(so.UUID); |
657 | m_scene.EventManager.TriggerParcelPrimCountTainted(); | 657 | m_scene.EventManager.TriggerParcelPrimCountTainted(); |
658 | 658 | ||
659 | so.RootPart.AttachedAvatar = avatar.UUID; | 659 | so.AttachedAvatar = avatar.UUID; |
660 | |||
661 | //Anakin Lohner bug #3839 | ||
662 | SceneObjectPart[] parts = so.Parts; | ||
663 | for (int i = 0; i < parts.Length; i++) | ||
664 | parts[i].AttachedAvatar = avatar.UUID; | ||
665 | 660 | ||
666 | if (so.RootPart.PhysActor != null) | 661 | if (so.RootPart.PhysActor != null) |
667 | { | 662 | { |