diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index b716980df2..fb8ec947be 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -672,6 +672,9 @@ namespace OpenSim.Region.Environment.Scenes return; } + // the avatar.Close below will clear the child region list. We need this below for (possibly) + // closing the child agents, so save it here (we need a copy as it is Clear()-ed). + List childRegions = new List(avatar.GetKnownRegionList()); avatar.Close(); // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport @@ -721,6 +724,7 @@ namespace OpenSim.Region.Environment.Scenes if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3) { SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); + SendCloseChildAgentConnections(avatar.UUID, childRegions); CloseConnection(m_regionInfo.RegionHandle, avatar.UUID); } // if (teleport success) // seems to be always success here