From fcc1fa2c32af3df8962e470150b641dda036a8ab Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 1 Feb 2012 09:36:14 +0000 Subject: Straighten out some attachment mess. Don't save attachment states for HG visitors at all. On Leaving a sim, save only the changed ones. Don't save all scripted stuff when leaving a sim. --- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index df6c88f..34d1151 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3104,7 +3104,17 @@ namespace OpenSim.Region.Framework.Scenes m_eventManager.TriggerOnRemovePresence(agentID); if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) - AttachmentsModule.SaveChangedAttachments(avatar); + { + IUserManagement uMan = m_aScene.RequestModuleInterface(); + // Don't save attachments for HG visitors, it + // messes up their inventory. When a HG visitor logs + // out on a foreign grid, their attachments will be + // reloaded in the state they were in when they left + // the home grid. This is best anyway as the visited + // grid may use an incompatible script engine. + if (uMan == null || uMan.IsLocalGridUser(id)) + AttachmentsModule.SaveChangedAttachments(avatar, false); + } ForEachClient( delegate(IClientAPI client) -- cgit v1.1