diff options
author | Justin Clark-Casey (justincc) | 2014-04-03 00:19:53 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-04-03 00:19:53 +0100 |
commit | e6d0dcd4e80275b96322eb10b31a2b339e4a2d17 (patch) | |
tree | 2563e97bad5770551262be0dacdc0dca771777b1 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | String matching in REST handlers: must allow '-' as a separator, because the ... (diff) | |
download | opensim-SC-e6d0dcd4e80275b96322eb10b31a2b339e4a2d17.zip opensim-SC-e6d0dcd4e80275b96322eb10b31a2b339e4a2d17.tar.gz opensim-SC-e6d0dcd4e80275b96322eb10b31a2b339e4a2d17.tar.bz2 opensim-SC-e6d0dcd4e80275b96322eb10b31a2b339e4a2d17.tar.xz |
Fix bug where crossing to a neighbouring region and back again would trigger an exception, and a second recross would stop the user moving until relog
Also fixes an issue where sitting avatar counts became inaccurate after any cross.
Part of the problem was due to cloning code using MemberwiseClone() but not resetting certain collection structures.
Adds regression test for this case.
In relation to http://opensimulator.org/mantis/view.php?id=7050
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index db4e285..c06175e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1753,7 +1753,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1753 | /// <returns></returns> | 1753 | /// <returns></returns> |
1754 | public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed) | 1754 | public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed) |
1755 | { | 1755 | { |
1756 | // FIXME: This is dangerous since it's easy to forget to reset some references when necessary and end up | ||
1757 | // with bugs that only occur in some circumstances (e.g. crossing between regions on the same simulator | ||
1758 | // but not between regions on different simulators). Really, all copying should be done explicitly. | ||
1756 | SceneObjectPart dupe = (SceneObjectPart)MemberwiseClone(); | 1759 | SceneObjectPart dupe = (SceneObjectPart)MemberwiseClone(); |
1760 | |||
1757 | dupe.m_shape = m_shape.Copy(); | 1761 | dupe.m_shape = m_shape.Copy(); |
1758 | dupe.m_regionHandle = m_regionHandle; | 1762 | dupe.m_regionHandle = m_regionHandle; |
1759 | if (userExposed) | 1763 | if (userExposed) |
@@ -1799,6 +1803,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1799 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); | 1803 | Array.Copy(Shape.ExtraParams, extraP, extraP.Length); |
1800 | dupe.Shape.ExtraParams = extraP; | 1804 | dupe.Shape.ExtraParams = extraP; |
1801 | 1805 | ||
1806 | dupe.m_sittingAvatars = new HashSet<OpenMetaverse.UUID>(); | ||
1807 | |||
1802 | // safeguard actual copy is done in sog.copy | 1808 | // safeguard actual copy is done in sog.copy |
1803 | dupe.KeyframeMotion = null; | 1809 | dupe.KeyframeMotion = null; |
1804 | dupe.PayPrice = (int[])PayPrice.Clone(); | 1810 | dupe.PayPrice = (int[])PayPrice.Clone(); |