Force regioncrossed prims to get a new LocalID. Reset parent local ID to new

avatar local ID when corssing.
0.6.1-post-fixes
Melanie Thielker 2008-11-28 03:28:39 +00:00
parent a7f3d2fbc2
commit 3ff34579e4
2 changed files with 14 additions and 1 deletions

View File

@ -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);

View File

@ -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);
}
}