diff options
author | Melanie | 2010-11-16 20:44:39 +0100 |
---|---|---|
committer | Melanie | 2010-11-16 20:44:39 +0100 |
commit | 4f15b8d4e6be1e1fe88ad32aa43595861d1005ad (patch) | |
tree | 5c6dd29543347ea43c2a46658a451b355fdbf528 /OpenSim/Region/Framework/Scenes/SceneGraph.cs | |
parent | Can't detach an object from within the script thread because it will throw. (diff) | |
download | opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.zip opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.gz opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.bz2 opensim-SC-4f15b8d4e6be1e1fe88ad32aa43595861d1005ad.tar.xz |
Change the way attachments are persisted. Editing a worn attachment will now
save properly, as will the results of a resizer script working. Attachment
positions are no longer saved on each move, but instead are saved once on
logout. Attachment script states are saved as part of the attachment now
when detaching.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index a462133..b2d9358 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
281 | } | 281 | } |
282 | } | 282 | } |
283 | 283 | ||
284 | if (!alreadyPersisted) | 284 | if (attachToBackup && (!alreadyPersisted)) |
285 | { | 285 | { |
286 | sceneObject.ForceInventoryPersistence(); | 286 | sceneObject.ForceInventoryPersistence(); |
287 | sceneObject.HasGroupChanged = true; | 287 | sceneObject.HasGroupChanged = true; |
@@ -304,8 +304,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
304 | /// </returns> | 304 | /// </returns> |
305 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | 305 | protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) |
306 | { | 306 | { |
307 | // Ensure that we persist this new scene object | 307 | // Ensure that we persist this new scene object if it's not an |
308 | sceneObject.HasGroupChanged = true; | 308 | // attachment |
309 | if (attachToBackup) | ||
310 | sceneObject.HasGroupChanged = true; | ||
309 | 311 | ||
310 | return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 312 | return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
311 | } | 313 | } |
@@ -1342,8 +1344,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
1342 | { | 1344 | { |
1343 | if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) | 1345 | if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) |
1344 | { | 1346 | { |
1345 | if (m_parentScene.AttachmentsModule != null) | 1347 | // Set the new attachment point data in the object |
1346 | m_parentScene.AttachmentsModule.UpdateAttachmentPosition(remoteClient, group, pos); | 1348 | byte attachmentPoint = group.GetAttachmentPoint(); |
1349 | group.UpdateGroupPosition(pos); | ||
1350 | group.RootPart.IsAttachment = false; | ||
1351 | group.AbsolutePosition = group.RootPart.AttachedPos; | ||
1352 | group.SetAttachmentPoint(attachmentPoint); | ||
1353 | group.HasGroupChanged = true; | ||
1347 | } | 1354 | } |
1348 | else | 1355 | else |
1349 | { | 1356 | { |