diff options
author | Melanie Thielker | 2010-07-14 20:46:26 +0200 |
---|---|---|
committer | Melanie | 2010-07-14 23:03:38 +0100 |
commit | 50d56c54a383f636aec67a6c3e98ddcd9f32f859 (patch) | |
tree | 75d84248a91608562906873095dcdaf80a3c6a2d /OpenSim/Region | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
download | opensim-SC-50d56c54a383f636aec67a6c3e98ddcd9f32f859.zip opensim-SC-50d56c54a383f636aec67a6c3e98ddcd9f32f859.tar.gz opensim-SC-50d56c54a383f636aec67a6c3e98ddcd9f32f859.tar.bz2 opensim-SC-50d56c54a383f636aec67a6c3e98ddcd9f32f859.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 902fb88..34198d2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -142,19 +142,33 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
142 | group.SetAttachmentPoint((byte)AttachmentPt); | 142 | group.SetAttachmentPoint((byte)AttachmentPt); |
143 | group.AbsolutePosition = attachPos; | 143 | group.AbsolutePosition = attachPos; |
144 | 144 | ||
145 | // Saves and gets itemID | 145 | // Remove any previous attachments |
146 | UUID itemId; | 146 | ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId); |
147 | UUID itemID = UUID.Zero; | ||
148 | if (sp != null) | ||
149 | { | ||
150 | foreach(SceneObjectGroup grp in sp.Attachments) | ||
151 | { | ||
152 | if (grp.GetAttachmentPoint() == (byte)AttachmentPt) | ||
153 | { | ||
154 | itemID = grp.GetFromItemID(); | ||
155 | break; | ||
156 | } | ||
157 | } | ||
158 | if (itemID != UUID.Zero) | ||
159 | DetachSingleAttachmentToInv(itemID, remoteClient); | ||
160 | } | ||
147 | 161 | ||
148 | if (group.GetFromItemID() == UUID.Zero) | 162 | if (group.GetFromItemID() == UUID.Zero) |
149 | { | 163 | { |
150 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemId); | 164 | m_scene.attachObjectAssetStore(remoteClient, group, remoteClient.AgentId, out itemID); |
151 | } | 165 | } |
152 | else | 166 | else |
153 | { | 167 | { |
154 | itemId = group.GetFromItemID(); | 168 | itemID = group.GetFromItemID(); |
155 | } | 169 | } |
156 | 170 | ||
157 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemId, group); | 171 | SetAttachmentInventoryStatus(remoteClient, AttachmentPt, itemID, group); |
158 | 172 | ||
159 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); | 173 | group.AttachToAgent(remoteClient.AgentId, AttachmentPt, attachPos, silent); |
160 | 174 | ||