Formatting cleanup, minor refactoring. Fixed some comparisons of value types and null.

This commit is contained in:
Jeff Ames
2008-05-18 23:06:50 +00:00
parent 901e97f821
commit 6ec680918b
14 changed files with 93 additions and 122 deletions

View File

@@ -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
/// <param name="action"></param>
public void ForEachScenePresence(Action<ScenePresence> 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
{