From 90dc5f47e7db7d921ad82033a581fcd5c5704906 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 21 Feb 2012 01:57:19 +0000 Subject: [PATCH] Fix bug where NPCs would establish child agents on other neighbour regions that had come up after the NPC was created. --- OpenSim/Region/Framework/Scenes/Scene.cs | 27 ++++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d2a8ad09ac..e7f835cdb6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -864,16 +864,16 @@ namespace OpenSim.Region.Framework.Scenes try { ForEachRootScenePresence(delegate(ScenePresence agent) - { - //agent.ControllingClient.new - //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); + { + //agent.ControllingClient.new + //this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo()); - List old = new List(); - old.Add(otherRegion.RegionHandle); - agent.DropOldNeighbours(old); - if (m_teleportModule != null) - m_teleportModule.EnableChildAgent(agent, otherRegion); - }); + List old = new List(); + old.Add(otherRegion.RegionHandle); + agent.DropOldNeighbours(old); + if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc) + m_teleportModule.EnableChildAgent(agent, otherRegion); + }); } catch (NullReferenceException) { @@ -881,7 +881,6 @@ namespace OpenSim.Region.Framework.Scenes // This shouldn't happen too often anymore. m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception"); } - } else { @@ -1009,10 +1008,10 @@ namespace OpenSim.Region.Framework.Scenes try { ForEachRootScenePresence(delegate(ScenePresence agent) - { - if (m_teleportModule != null) - m_teleportModule.EnableChildAgent(agent, r); - }); + { + if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc) + m_teleportModule.EnableChildAgent(agent, r); + }); } catch (NullReferenceException) {