UbitUmarov преди 3 седмици
родител
ревизия
ffb4cd7867

+ 1 - 1
OpenSim/Data/MySQL/MySQLUserProfilesData.cs

@@ -803,7 +803,7 @@ namespace OpenSim.Data.MySQL
                             {
                                 while (reader.Read())
                                 {
-                                    data.Add(new OSDString((string)reader["snapshotuuid"].ToString ()));
+                                    data.Add(new OSDString(reader["snapshotuuid"].ToString ()));
                                 }
                             }
                         }

+ 1 - 3
OpenSim/Framework/Animation.cs

@@ -140,9 +140,7 @@ namespace OpenSim.Framework
 
         public override string ToString()
         {
-            return "AnimID=" + AnimID.ToString()
-                + "/seq=" + SequenceNum.ToString()
-                + "/objID=" + ObjectID.ToString();
+            return $"AnimID= {AnimID}/seq={SequenceNum}/objID={ObjectID}";
         }
 
     }

+ 0 - 1
OpenSim/Framework/Monitoring/JobEngine.cs

@@ -257,7 +257,6 @@ namespace OpenSim.Framework.Monitoring
                     m_log.DebugFormat("[{0}]: Processed job {1}",LoggingName,currentJob.Name);
 
                 currentJob.Action = null;
-                currentJob = null;
             }
             lock (JobLock)
                 --m_numberThreads;

+ 6 - 20
OpenSim/Region/Framework/Scenes/Scripting/ScriptUtils.cs

@@ -25,8 +25,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-using System;
-using System.Collections.Generic;
 using OpenMetaverse;
 using OpenSim.Framework;
 
@@ -64,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
         /// <returns></returns>
         public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier)
         {
-            if(string.IsNullOrEmpty(identifier))
+            if(string.IsNullOrEmpty(identifier) || part.Inventory is null)
                 return UUID.Zero;
 
             // if we can parse the string as a key, use it.
@@ -73,14 +71,8 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
             if (UUID.TryParse(identifier, out UUID key))
                 return key;
 
-            if (part.Inventory != null)
-            {
-                TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
-                if (item != null)
-                    return item.AssetID;
-            }
-
-            return UUID.Zero;
+            TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);
+            return item is not null ? item.AssetID : UUID.Zero;
         }
 
         /// <summary>
@@ -93,17 +85,11 @@ namespace OpenSim.Region.Framework.Scenes.Scripting
         /// <returns></returns>
         public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier, AssetType type)
         {
-            if (UUID.TryParse(identifier, out UUID key))
+            if (UUID.TryParse(identifier, out UUID key) || part.Inventory is null)
                 return key;
 
-            if (part.Inventory is not null)
-            {
-                TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier, (int)type);
-                if (item is not null)
-                    return item.AssetID;
-            }
-
-            return UUID.Zero;
+            TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier, (int)type);
+            return item is not null ? item.AssetID : UUID.Zero;
         }
 
         public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, SceneObjectPart host, string identifier, AssetType type)

+ 1 - 1
OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs

@@ -639,7 +639,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
 
         public bool IsGroupMember(UUID groupID)
         {
-            return (m_hostGroupID == groupID);
+            return m_hostGroupID.Equals(groupID);
         }
 
         public Dictionary<UUID, ulong> GetGroupPowers()