mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
Removed use of 'is' operator and casting to find the root ScenePresence in MessageTransfer modules and Groups module.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user