* Fix attachment cross issues with new borders.
parent
895c612647
commit
b997174d08
|
@ -1710,7 +1710,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
int thisx = (int)RegionInfo.RegionLocX;
|
int thisx = (int)RegionInfo.RegionLocX;
|
||||||
int thisy = (int)RegionInfo.RegionLocY;
|
int thisy = (int)RegionInfo.RegionLocY;
|
||||||
|
|
||||||
ulong newRegionHandle = 0;
|
|
||||||
|
// use this if no borders were crossed!
|
||||||
|
ulong newRegionHandle
|
||||||
|
= Util.UIntsToLong((uint)((thisx) * Constants.RegionSize),
|
||||||
|
(uint)((thisy) * Constants.RegionSize));
|
||||||
|
|
||||||
Vector3 pos = attemptedPosition;
|
Vector3 pos = attemptedPosition;
|
||||||
|
|
||||||
if (TestBorderCross(attemptedPosition, Cardinals.W))
|
if (TestBorderCross(attemptedPosition, Cardinals.W))
|
||||||
|
|
|
@ -1477,8 +1477,26 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
|
SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
|
||||||
dupe.m_isBackedUp = false;
|
dupe.m_isBackedUp = false;
|
||||||
dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
|
dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
|
||||||
|
|
||||||
|
// Warning, The following code related to previousAttachmentStatus is needed so that clones of
|
||||||
|
// attachments do not bordercross while they're being duplicated. This is hacktastic!
|
||||||
|
// Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
|
||||||
|
// unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
|
||||||
|
// (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
|
||||||
|
// then restore it's attachment state
|
||||||
|
|
||||||
|
// This is only necessary when userExposed is false!
|
||||||
|
|
||||||
|
bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
|
||||||
|
|
||||||
|
if (!userExposed)
|
||||||
|
dupe.RootPart.IsAttachment = true;
|
||||||
|
|
||||||
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||||
|
|
||||||
|
if (!userExposed)
|
||||||
|
dupe.RootPart.IsAttachment = previousAttachmentStatus;
|
||||||
|
|
||||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
|
||||||
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
|
dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
|
||||||
|
|
||||||
|
|
|
@ -3509,8 +3509,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// Set the parent localID to 0 so it transfers over properly.
|
// Set the parent localID to 0 so it transfers over properly.
|
||||||
gobj.RootPart.SetParentLocalId(0);
|
gobj.RootPart.SetParentLocalId(0);
|
||||||
gobj.RootPart.IsAttachment = false;
|
|
||||||
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
|
||||||
|
gobj.RootPart.IsAttachment = false;
|
||||||
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
||||||
m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, regionHandle);
|
m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, regionHandle);
|
||||||
m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj, silent);
|
m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj, silent);
|
||||||
|
|
Loading…
Reference in New Issue