From 10d9a257f89e1064020903e230d081b000130293 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 30 Nov 2023 20:28:34 +0800 Subject: [PATCH] =?UTF-8?q?Name=E5=B1=9E=E6=80=A7=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E7=9A=84=E6=8F=92=E4=BB=B6=E4=B8=8D=E5=85=81=E8=AE=B8=E8=A2=AB?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/AddonManager.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Service/AddonManager.cs b/Service/AddonManager.cs index eba5e42..13fe8e8 100644 --- a/Service/AddonManager.cs +++ b/Service/AddonManager.cs @@ -28,7 +28,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Plugin)))) { Plugin? instance = (Plugin?)Activator.CreateInstance(type); - if (instance != null && instance.Load(objs)) + if (instance != null && instance.Load(objs) && instance.Name.Trim() != "") { plugins.TryAdd(instance.Name, instance); } @@ -60,7 +60,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameMode)))) { GameMode? instance = (GameMode?)Activator.CreateInstance(type); - if (instance != null && instance.Load(objs)) + if (instance != null && instance.Load(objs) && instance.Name.Trim() != "") { gamemodes.TryAdd(instance.Name, instance); } @@ -69,7 +69,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Character)))) { Character? instance = (Character?)Activator.CreateInstance(type); - if (instance != null && !Characters.Contains(instance)) + if (instance != null && instance.Name.Trim() != "" && !Characters.Contains(instance)) { Characters.Add(instance); } @@ -78,7 +78,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Skill)))) { Skill? instance = (Skill?)Activator.CreateInstance(type); - if (instance != null && !Skills.Contains(instance)) + if (instance != null && instance.Name.Trim() != "" && !Skills.Contains(instance)) { Skills.Add(instance); } @@ -87,7 +87,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(Item)))) { Item? instance = (Item?)Activator.CreateInstance(type); - if (instance != null && !Items.Contains(instance)) + if (instance != null && instance.Name.Trim() != "" && !Items.Contains(instance)) { Items.Add(instance); } @@ -116,7 +116,7 @@ namespace Milimoe.FunGame.Core.Service foreach (Type type in assembly.GetTypes().AsEnumerable().Where(type => type.IsSubclassOf(typeof(GameMap)))) { GameMap? instance = (GameMap?)Activator.CreateInstance(type); - if (instance != null && instance.Load(objs)) + if (instance != null && instance.Load(objs) && instance.Name.Trim() != "") { gamemaps.TryAdd(instance.Name, instance); }