mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
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:
@@ -259,7 +259,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected internal bool AddRestoredSceneObject(
|
||||
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
|
||||
{
|
||||
if (!alreadyPersisted)
|
||||
if (attachToBackup && (!alreadyPersisted))
|
||||
{
|
||||
sceneObject.ForceInventoryPersistence();
|
||||
sceneObject.HasGroupChanged = true;
|
||||
@@ -282,8 +282,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);
|
||||
}
|
||||
@@ -1279,8 +1281,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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user