From 6ec680918bc6876f1c1382fb534b653fc34da052 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 18 May 2008 23:06:50 +0000 Subject: Formatting cleanup, minor refactoring. Fixed some comparisons of value types and null. --- OpenSim/Region/Environment/Scenes/Scene.cs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d4b85c2..e1764b5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2658,7 +2658,7 @@ namespace OpenSim.Region.Environment.Scenes ClientManager.ForEachClient(delegate(IClientAPI controller) { ScenePresence p = GetScenePresence(controller.AgentId); - bool childagent = !p.Equals(null) && p.IsChildAgent; + bool childagent = p != null && p.IsChildAgent; if (controller.AgentId != godID && !childagent) // Do we really want to kick the initiator of this madness? { @@ -2669,14 +2669,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - if (m_scenePresences[agentID].IsChildAgent) - { - m_innerScene.removeUserCount(false); - } - else - { - m_innerScene.removeUserCount(true); - } + m_innerScene.removeUserCount(!m_scenePresences[agentID].IsChildAgent); m_scenePresences[agentID].ControllingClient.Kick(Helpers.FieldToUTF8String(reason)); m_scenePresences[agentID].ControllingClient.Close(true); @@ -2696,7 +2689,6 @@ namespace OpenSim.Region.Environment.Scenes // Check for spoofing.. since this is permissions we're talking about here! if ((controller.SessionId == sessionID) && (controller.AgentId == agentID)) { - // Tell the object to do permission update if (localId != 0) { @@ -2706,7 +2698,6 @@ namespace OpenSim.Region.Environment.Scenes chObjectGroup.UpdatePermissions(agentID, field, localId, mask, set); } } - } } @@ -3126,8 +3117,8 @@ namespace OpenSim.Region.Environment.Scenes /// public void ForEachScenePresence(Action action) { - // We don't want to try to send messages if there are no avatar. - if (!(m_scenePresences.Equals(null))) + // We don't want to try to send messages if there are no avatars. + if (m_scenePresences != null) { try { -- cgit v1.1