From 1b3a3ffc7781a468f40841ee291d3f1e0fe22957 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 29 Nov 2008 13:17:21 +0000 Subject: Finally make attachments stay put. Randomize local ID generation to prevent adjacent sims from using identical Local IDs for the attachment Thanks to Mana Janus (Hippo Viewer) for providing the crucial bit of information, namely that, due to a bug in the viewer, adjacent sims can't use the same local ids. --- .../Region/Environment/Modules/World/Land/LandManagementModule.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs index 68aee86..0c4e6db 100644 --- a/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Land/LandManagementModule.cs @@ -556,7 +556,12 @@ namespace OpenSim.Region.Environment.Modules.World.Land } lock (m_landList) { - return m_landList[m_landIDList[x, y]]; + // Corner case. If an autoreturn happens during sim startup + // we will come here with the list uninitialized + // + if (m_landList.ContainsKey(m_landIDList[x, y])) + return m_landList[m_landIDList[x, y]]; + return null; } } -- cgit v1.1