aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-31 20:07:33 -0400
committerTeravus Ovares (Dan Olivares)2009-08-31 20:07:33 -0400
commitb997174d08919fc69f29109b28e054d995672d0e (patch)
treeae6db3ea8cc2f62608cae20ab7e0147f866a9652 /OpenSim/Region/Framework
parent* When the RegionCombinerModule is active add an extra set of borders with In... (diff)
downloadopensim-SC_OLD-b997174d08919fc69f29109b28e054d995672d0e.zip
opensim-SC_OLD-b997174d08919fc69f29109b28e054d995672d0e.tar.gz
opensim-SC_OLD-b997174d08919fc69f29109b28e054d995672d0e.tar.bz2
opensim-SC_OLD-b997174d08919fc69f29109b28e054d995672d0e.tar.xz
* Fix attachment cross issues with new borders.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
3 files changed, 25 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b8c8f32..f4a0d2e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1710,7 +1710,12 @@ namespace OpenSim.Region.Framework.Scenes
1710 int thisx = (int)RegionInfo.RegionLocX; 1710 int thisx = (int)RegionInfo.RegionLocX;
1711 int thisy = (int)RegionInfo.RegionLocY; 1711 int thisy = (int)RegionInfo.RegionLocY;
1712 1712
1713 ulong newRegionHandle = 0; 1713
1714 // use this if no borders were crossed!
1715 ulong newRegionHandle
1716 = Util.UIntsToLong((uint)((thisx) * Constants.RegionSize),
1717 (uint)((thisy) * Constants.RegionSize));
1718
1714 Vector3 pos = attemptedPosition; 1719 Vector3 pos = attemptedPosition;
1715 1720
1716 if (TestBorderCross(attemptedPosition, Cardinals.W)) 1721 if (TestBorderCross(attemptedPosition, Cardinals.W))
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e5c6bf1..d72ed7d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1477,8 +1477,26 @@ namespace OpenSim.Region.Framework.Scenes
1477 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone(); 1477 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
1478 dupe.m_isBackedUp = false; 1478 dupe.m_isBackedUp = false;
1479 dupe.m_parts = new Dictionary<UUID, SceneObjectPart>(); 1479 dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
1480
1481 // Warning, The following code related to previousAttachmentStatus is needed so that clones of
1482 // attachments do not bordercross while they're being duplicated. This is hacktastic!
1483 // Normally, setting AbsolutePosition will bordercross a prim if it's outside the region!
1484 // unless IsAttachment is true!, so to prevent border crossing, we save it's attachment state
1485 // (which should be false anyway) set it as an Attachment and then set it's Absolute Position,
1486 // then restore it's attachment state
1487
1488 // This is only necessary when userExposed is false!
1489
1490 bool previousAttachmentStatus = dupe.RootPart.IsAttachment;
1491
1492 if (!userExposed)
1493 dupe.RootPart.IsAttachment = true;
1494
1480 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 1495 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
1481 1496
1497 if (!userExposed)
1498 dupe.RootPart.IsAttachment = previousAttachmentStatus;
1499
1482 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); 1500 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
1483 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; 1501 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
1484 1502
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 46e3289..857dc11 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3509,8 +3509,8 @@ namespace OpenSim.Region.Framework.Scenes
3509 { 3509 {
3510 // Set the parent localID to 0 so it transfers over properly. 3510 // Set the parent localID to 0 so it transfers over properly.
3511 gobj.RootPart.SetParentLocalId(0); 3511 gobj.RootPart.SetParentLocalId(0);
3512 gobj.RootPart.IsAttachment = false;
3513 gobj.AbsolutePosition = gobj.RootPart.AttachedPos; 3512 gobj.AbsolutePosition = gobj.RootPart.AttachedPos;
3513 gobj.RootPart.IsAttachment = false;
3514 //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID(); 3514 //gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
3515 m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, regionHandle); 3515 m_log.DebugFormat("[ATTACHMENT]: Sending attachment {0} to region {1}", gobj.UUID, regionHandle);
3516 m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj, silent); 3516 m_scene.CrossPrimGroupIntoNewRegion(regionHandle, gobj, silent);