From 3ff34579e4813cb0568503bdbe62a40eb964e442 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 28 Nov 2008 03:28:39 +0000 Subject: Force regioncrossed prims to get a new LocalID. Reset parent local ID to new avatar local ID when corssing. --- OpenSim/Region/Environment/Scenes/Scene.cs | 8 ++++++++ OpenSim/Region/Environment/Scenes/SceneGraph.cs | 7 ++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 594972d..29f1302 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2146,6 +2146,11 @@ namespace OpenSim.Region.Environment.Scenes { SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); + // Force allocation of new LocalId + // + foreach (SceneObjectPart p in sceneObject.Children.Values) + p.LocalId = 0; + AddRestoredSceneObject(sceneObject, true, false); SceneObjectPart RootPrim = GetSceneObjectPart(primID); @@ -2185,6 +2190,9 @@ namespace OpenSim.Region.Environment.Scenes // LastOwnerID is used for group deeding, so when you do stuff // with the deeded object, it goes back to them + foreach (SceneObjectPart prim in grp.Children.Values) + prim.ParentID = sp.LocalId; + grp.SetFromAssetID(grp.RootPart.LastOwnerID); m_log.DebugFormat("[ATTACHMENT]: Attach to avatar {0}", sp.UUID.ToString()); AttachObject(sp.ControllingClient, grp.LocalId, (uint)0, grp.GroupRotation, grp.AbsolutePosition, false); diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index 3b6aa15..6901728 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs @@ -1440,7 +1440,12 @@ namespace OpenSim.Region.Environment.Scenes if (ent is SceneObjectGroup) { SceneObjectGroup obj = (SceneObjectGroup)ent; - sceneObjects.Add(obj.LocalId, obj); + // Nasty one. Can't unlink anything in the sim + // If a duplicate local ID sneaks in + // So, check it here! + // + if (!sceneObjects.ContainsKey(obj.LocalId)) + sceneObjects.Add(obj.LocalId, obj); } } -- cgit v1.1