Begin weaponschein
This commit is contained in:
@@ -16,7 +16,7 @@ namespace ReallifeGamemode.Server.Core
|
||||
internal static IAPI API { get; private set; }
|
||||
internal static Events.EventHandler EventHandler { get; private set; }
|
||||
|
||||
private static List<Script> loadedScripts = new List<Script>();
|
||||
private static readonly List<Script> loadedScripts = new List<Script>();
|
||||
|
||||
private readonly ILogger logger = LogManager.GetLogger<Main>();
|
||||
|
||||
@@ -36,10 +36,10 @@ namespace ReallifeGamemode.Server.Core
|
||||
|
||||
private void LoadScript()
|
||||
{
|
||||
var allTypes = Assembly.GetExecutingAssembly().GetTypes();
|
||||
var commandTypes = allTypes.Where(t => t.IsSubclassOf(typeof(Script)) && !t.IsAbstract);
|
||||
var allTypes = typeof(Main).Assembly.GetTypes();
|
||||
var scriptTypes = allTypes.Where(t => t.IsSubclassOf(typeof(Script)) && !t.IsAbstract);
|
||||
|
||||
foreach (var scriptType in commandTypes)
|
||||
foreach (var scriptType in scriptTypes)
|
||||
{
|
||||
logger.LogDebug("Loading script '{FullName}'", scriptType.FullName);
|
||||
var script = Activator.CreateInstance(scriptType) as Script;
|
||||
|
||||
Reference in New Issue
Block a user