mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
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
This commit is contained in:
@@ -1753,7 +1753,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
public SceneObjectPart Copy(uint localID, UUID AgentID, UUID GroupID, int linkNum, bool userExposed)
|
||||
{
|
||||
// FIXME: This is dangerous since it's easy to forget to reset some references when necessary and end up
|
||||
// with bugs that only occur in some circumstances (e.g. crossing between regions on the same simulator
|
||||
// but not between regions on different simulators). Really, all copying should be done explicitly.
|
||||
SceneObjectPart dupe = (SceneObjectPart)MemberwiseClone();
|
||||
|
||||
dupe.m_shape = m_shape.Copy();
|
||||
dupe.m_regionHandle = m_regionHandle;
|
||||
if (userExposed)
|
||||
@@ -1799,6 +1803,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
|
||||
dupe.Shape.ExtraParams = extraP;
|
||||
|
||||
dupe.m_sittingAvatars = new HashSet<OpenMetaverse.UUID>();
|
||||
|
||||
// safeguard actual copy is done in sog.copy
|
||||
dupe.KeyframeMotion = null;
|
||||
dupe.PayPrice = (int[])PayPrice.Clone();
|
||||
|
||||
Reference in New Issue
Block a user