Fixed tree crossing. This will alleviate

http://opensimulator.org/mantis/view.php?id=4163
prioritization
Diva Canto 2009-10-11 13:46:19 -07:00
parent 36dcfd2b80
commit ef6aa444bf
1 changed files with 52 additions and 54 deletions

View File

@ -2284,75 +2284,73 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart p in sceneObject.Children.Values) foreach (SceneObjectPart p in sceneObject.Children.Values)
p.LocalId = 0; p.LocalId = 0;
if (sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) if ((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0)) // Attachment
{ {
if (sceneObject.RootPart.Shape.State != 0) // Attachment sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez);
sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
AddRestoredSceneObject(sceneObject, false, false);
// Handle attachment special case
SceneObjectPart RootPrim = sceneObject.RootPart;
// Fix up attachment Parent Local ID
ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
//uint parentLocalID = 0;
if (sp != null)
{ {
sceneObject.RootPart.AddFlag(PrimFlags.TemporaryOnRez); //parentLocalID = sp.LocalId;
sceneObject.RootPart.AddFlag(PrimFlags.Phantom);
AddRestoredSceneObject(sceneObject, false, false); //sceneObject.RootPart.IsAttachment = true;
//sceneObject.RootPart.SetParentLocalId(parentLocalID);
// Handle attachment special case SceneObjectGroup grp = sceneObject;
SceneObjectPart RootPrim = sceneObject.RootPart;
// Fix up attachment Parent Local ID //RootPrim.SetParentLocalId(parentLocalID);
ScenePresence sp = GetScenePresence(sceneObject.OwnerID);
//uint parentLocalID = 0; m_log.DebugFormat("[ATTACHMENT]: Received " +
if (sp != null) "attachment {0}, inworld asset id {1}",
{ //grp.RootPart.LastOwnerID.ToString(),
//parentLocalID = sp.LocalId; grp.GetFromItemID(),
grp.UUID.ToString());
//sceneObject.RootPart.IsAttachment = true;
//sceneObject.RootPart.SetParentLocalId(parentLocalID);
SceneObjectGroup grp = sceneObject;
//RootPrim.SetParentLocalId(parentLocalID);
m_log.DebugFormat("[ATTACHMENT]: Received " +
"attachment {0}, inworld asset id {1}",
//grp.RootPart.LastOwnerID.ToString(),
grp.GetFromItemID(),
grp.UUID.ToString());
//grp.SetFromAssetID(grp.RootPart.LastOwnerID);
m_log.DebugFormat("[ATTACHMENT]: Attach " +
"to avatar {0} at position {1}",
sp.UUID.ToString(), grp.AbsolutePosition);
AttachObject(sp.ControllingClient,
grp.LocalId, (uint)0,
grp.GroupRotation,
grp.AbsolutePosition, false);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate();
}
else
{
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
//grp.SetFromAssetID(grp.RootPart.LastOwnerID);
m_log.DebugFormat("[ATTACHMENT]: Attach " +
"to avatar {0} at position {1}",
sp.UUID.ToString(), grp.AbsolutePosition);
AttachObject(sp.ControllingClient,
grp.LocalId, (uint)0,
grp.GroupRotation,
grp.AbsolutePosition, false);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
grp.SendGroupFullUpdate();
} }
else else
{ {
AddRestoredSceneObject(sceneObject, true, false); RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
if (!Permissions.CanObjectEntry(sceneObject.UUID, }
true, sceneObject.AbsolutePosition)) else
{ {
// Deny non attachments based on parcel settings AddRestoredSceneObject(sceneObject, true, false);
//
m_log.Info("[INTERREGION]: Denied prim crossing " +
"because of parcel settings");
DeleteSceneObject(sceneObject, false); if (!Permissions.CanObjectEntry(sceneObject.UUID,
true, sceneObject.AbsolutePosition))
{
// Deny non attachments based on parcel settings
//
m_log.Info("[INTERREGION]: Denied prim crossing " +
"because of parcel settings");
return false; DeleteSceneObject(sceneObject, false);
}
return false;
} }
} }
return true; return true;
} }
#endregion #endregion