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.
This commit is contained in:
Melanie
2010-11-16 20:44:39 +01:00
parent c2ac5dc358
commit 4f15b8d4e6
13 changed files with 105 additions and 69 deletions

View File

@@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
if (!alreadyPersisted)
if (attachToBackup && (!alreadyPersisted))
{
sceneObject.ForceInventoryPersistence();
sceneObject.HasGroupChanged = true;
@@ -304,8 +304,10 @@ namespace OpenSim.Region.Framework.Scenes
/// </returns>
protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
{
// Ensure that we persist this new scene object
sceneObject.HasGroupChanged = true;
// Ensure that we persist this new scene object if it's not an
// attachment
if (attachToBackup)
sceneObject.HasGroupChanged = true;
return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
}
@@ -1342,8 +1344,13 @@ namespace OpenSim.Region.Framework.Scenes
{
if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
{
if (m_parentScene.AttachmentsModule != null)
m_parentScene.AttachmentsModule.UpdateAttachmentPosition(remoteClient, group, pos);
// Set the new attachment point data in the object
byte attachmentPoint = group.GetAttachmentPoint();
group.UpdateGroupPosition(pos);
group.RootPart.IsAttachment = false;
group.AbsolutePosition = group.RootPart.AttachedPos;
group.SetAttachmentPoint(attachmentPoint);
group.HasGroupChanged = true;
}
else
{