aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 673674d..240c688 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -599,7 +599,7 @@ namespace OpenSim.Region.Framework.Scenes
599 if (!Entities.Remove(agentID)) 599 if (!Entities.Remove(agentID))
600 { 600 {
601 m_log.WarnFormat( 601 m_log.WarnFormat(
602 "[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene Entities list", 602 "[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene Entities list",
603 agentID); 603 agentID);
604 } 604 }
605 605
@@ -607,12 +607,13 @@ namespace OpenSim.Region.Framework.Scenes
607 { 607 {
608 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap); 608 Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
609 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray); 609 List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
610 610
611 // Remember the old presene reference from the dictionary
612 ScenePresence oldref = newmap[agentID];
613 // Remove the presence reference from the dictionary 611 // Remove the presence reference from the dictionary
614 if (newmap.Remove(agentID)) 612 if (newmap.ContainsKey(agentID))
615 { 613 {
614 ScenePresence oldref = newmap[agentID];
615 newmap.Remove(agentID);
616
616 // Find the index in the list where the old ref was stored and remove the reference 617 // Find the index in the list where the old ref was stored and remove the reference
617 newlist.RemoveAt(newlist.IndexOf(oldref)); 618 newlist.RemoveAt(newlist.IndexOf(oldref));
618 // Swap out the dictionary and list with new references 619 // Swap out the dictionary and list with new references
@@ -621,7 +622,7 @@ namespace OpenSim.Region.Framework.Scenes
621 } 622 }
622 else 623 else
623 { 624 {
624 m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID); 625 m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
625 } 626 }
626 } 627 }
627 } 628 }