Small optimization to last commit

iar_mods
Melanie 2012-02-01 10:05:04 +00:00
parent cc1476fc36
commit 003bd9f1b3
1 changed files with 5 additions and 5 deletions

View File

@ -3056,11 +3056,11 @@ namespace OpenSim.Region.Framework.Scenes
public override void RemoveClient(UUID agentID, bool closeChildAgents)
{
CheckHeartbeat();
bool childagentYN = false;
bool isChildAgent = false;
ScenePresence avatar = GetScenePresence(agentID);
if (avatar != null)
{
childagentYN = avatar.IsChildAgent;
isChildAgent = avatar.IsChildAgent;
if (avatar.ParentID != 0)
{
@ -3071,9 +3071,9 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.DebugFormat(
"[SCENE]: Removing {0} agent {1} from region {2}",
(childagentYN ? "child" : "root"), agentID, RegionInfo.RegionName);
(isChildAgent ? "child" : "root"), agentID, RegionInfo.RegionName);
m_sceneGraph.removeUserCount(!childagentYN);
m_sceneGraph.removeUserCount(!isChildAgent);
// TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop
// unnecessary operations. This should go away once NPCs have no accompanying IClientAPI
@ -3103,7 +3103,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_eventManager.TriggerOnRemovePresence(agentID);
if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc)
if (AttachmentsModule != null && !isChildAgent && avatar.PresenceType != PresenceType.Npc)
{
IUserManagement uMan = RequestModuleInterface<IUserManagement>();
// Don't save attachments for HG visitors, it