From 272bf712796ad8e98e79aee50311a84deaf23d79 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 27 Oct 2011 02:26:37 -0700 Subject: Removed use of 'is' operator and casting to find the root ScenePresence in MessageTransfer modules and Groups module. --- .../OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs') diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 630fcab..b2c0f48 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -1076,17 +1076,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Try root avatar first foreach (Scene scene in m_sceneList) { - if (scene.Entities.ContainsKey(agentID) && - scene.Entities[agentID] is ScenePresence) + ScenePresence sp = scene.GetScenePresence(agentID); + if (sp != null) { - ScenePresence user = (ScenePresence)scene.Entities[agentID]; - if (!user.IsChildAgent) + if (!sp.IsChildAgent) { - return user.ControllingClient; + return sp.ControllingClient; } else { - child = user.ControllingClient; + child = sp.ControllingClient; } } } -- cgit v1.1