When detaching a scripted item, always consider it modified. Script states

will have changed and for real usability, we need to save it. It bloats
assets, but that can't be avoided.
avinationmerge
Melanie 2010-11-16 01:35:45 +01:00
parent 0f152bfe8c
commit 7a9c57a81e
2 changed files with 9 additions and 1 deletions

View File

@ -527,10 +527,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
/// <param name="grp"></param>
/// <param name="itemID"></param>
/// <param name="agentID"></param>
protected void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
{
if (grp != null)
{
// If an item contains scripts, it's always changed.
// This ensures script state is saved on detach
foreach (SceneObjectPart p in grp.Parts)
if (p.Inventory.ContainsScripts())
grp.HasGroupChanged = true;
if (!grp.HasGroupChanged)
{
m_log.WarnFormat("[ATTACHMENTS MODULE]: Save request for {0} which is unchanged", grp.UUID);

View File

@ -133,5 +133,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="sog"></param>
/// <param name="pos"></param>
void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos);
void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID);
}
}