diff options
author | Melanie Thielker | 2010-07-14 20:46:26 +0200 |
---|---|---|
committer | Melanie | 2010-07-14 23:04:05 +0100 |
commit | 264f4f07cde42d2df7c6f7c2b3cec429f0595a5c (patch) | |
tree | 8752c4a6fbb98db6c5757331de50ac1a3ff572a7 /OpenSim/Region | |
parent | Major attachments cleanup. Remove unused AttachObject ClientView method (diff) | |
download | opensim-SC-264f4f07cde42d2df7c6f7c2b3cec429f0595a5c.zip opensim-SC-264f4f07cde42d2df7c6f7c2b3cec429f0595a5c.tar.gz opensim-SC-264f4f07cde42d2df7c6f7c2b3cec429f0595a5c.tar.bz2 opensim-SC-264f4f07cde42d2df7c6f7c2b3cec429f0595a5c.tar.xz |
Detach attachments displaced by other attachments
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 527934d..ff3036a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -140,19 +140,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
140 | group.SetAttachmentPoint((byte)AttachmentPt); | 140 | group.SetAttachmentPoint((byte)AttachmentPt); |
141 | group.AbsolutePosition = attachPos; | 141 | group.AbsolutePosition = attachPos; |
142 | 142 | ||
143 | // Saves and gets itemID | 143 | // Remove any previous attachments |
144 | UUID itemId; | 144 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); |
145 | UUID itemID = UUID.Zero; | ||
146 | if (sp != null) | ||
147 | { | ||
148 | foreach(SceneObjectGroup grp in sp.Attachments) | ||
149 | { | ||
150 | if (grp.GetAttachmentPoint() == (byte)AttachmentPt) | ||
151 | { | ||
152 | itemID = grp.GetFromItemID(); | ||
153 | break; | ||
154 | } | ||
155 | } | ||
156 | if (itemID != UUID.Zero) | ||
157 | DetachSingleAttachmentToInv(itemID, remoteClient); | ||
158 | } | ||
145 | 159 | ||
146 | if (group.GetFromItemID() == UUID.Zero) | 160 | if (group.GetFromItemID() == UUID.Zero) |
147 | { | 161 | { |
148 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId); | 162 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); |
149 | } | 163 | } |
150 | else | 164 | else |
151 | { | 165 | { |
152 | itemId = group.GetFromItemID(); | 166 | itemID = group.GetFromItemID(); |
153 | } | 167 | } |
154 | 168 | ||
155 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemId, group); | 169 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); |
156 | 170 | ||
157 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 171 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
158 | 172 | ||