From a0e1be3280e4be49cf0ca8d211b97ef8c1ddee2f Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 19 Mar 2008 09:36:13 +0000 Subject: Fixed some comparisons of LLUUIDs to null. Thanks to DrSchofld for pointing this out. --- OpenSim/Region/Environment/Modules/XMLRPCModule.cs | 4 ++-- OpenSim/Region/Environment/PermissionManager.cs | 10 +++------- .../Region/Environment/Scenes/SceneObjectGroup.Inventory.cs | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs index 67ebbf8..4f52ad6 100644 --- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs @@ -163,7 +163,7 @@ namespace OpenSim.Region.Environment.Modules public LLUUID OpenXMLRPCChannel(uint localID, LLUUID itemID) { - LLUUID channel = null; + LLUUID channel = new LLUUID(); //Is a dupe? foreach (RPCChannelInfo ci in m_openChannels.Values) @@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Modules } } - if ((channel.Equals(null)) || (channel.Equals(LLUUID.Zero))) + if (channel == LLUUID.Zero) { channel = LLUUID.Random(); RPCChannelInfo rpcChanInfo = new RPCChannelInfo(localID, itemID, channel); diff --git a/OpenSim/Region/Environment/PermissionManager.cs b/OpenSim/Region/Environment/PermissionManager.cs index a23f119..3d008a7 100644 --- a/OpenSim/Region/Environment/PermissionManager.cs +++ b/OpenSim/Region/Environment/PermissionManager.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.Environment } // If there is no master avatar, return false - if (!m_scene.RegionInfo.MasterAvatarAssignedUUID.Equals(null)) + if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero) { return m_scene.RegionInfo.MasterAvatarAssignedUUID == user; } @@ -96,7 +96,8 @@ namespace OpenSim.Region.Environment { return true; } - if (!user.Equals(null)) + + if (user != LLUUID.Zero) { LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers; for (int i = 0; i < estatemanagers.Length; i++) @@ -105,11 +106,6 @@ namespace OpenSim.Region.Environment return true; } } - // The below is commented out because logically it happens anyway. It's left in for readability - //else - //{ - //return false; - //} return false; } diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs index e02faaf..967ba0b 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs @@ -178,8 +178,8 @@ namespace OpenSim.Region.Environment.Scenes public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item, LLUUID copyItemID) { - LLUUID newItemId = (!copyItemID.Equals(null)) ? copyItemID : item.inventoryID; - + LLUUID newItemId = (copyItemID != LLUUID.Zero) ? copyItemID : item.inventoryID; + SceneObjectPart part = GetChildPart(localID); if (part != null) { -- cgit v1.1