Merge pull request #75 from oiltanker/master
fix for non-local mods folder regex and mod assembly type not found
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Barotrauma
|
||||
public bool HasSources { get => sources.Count > 0; }
|
||||
|
||||
private enum SourceCategory { Shared, Server, Client };
|
||||
private Regex rMaskPathValid = new Regex(@"^[^/]+/[^/]+/csharp(/(shared|client|server))?(/[^/]+)+\.cs$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private Regex rMaskPathValid = new Regex(@"^(((?!csharp)[^/])+/)+csharp(/(shared|client|server))?(/[^/]+)+\.cs$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private Regex rMaskPathCategory1 = new Regex(@"/(shared|client|server)(/[^/]+)+\.cs$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private Regex rMaskPathCategory2 = new Regex(@"^/(shared|client|server)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
||||
private void RunFolder(string folder)
|
||||
|
||||
@@ -432,6 +432,7 @@ namespace Barotrauma
|
||||
foreach (var elem in typesElem.Elements())
|
||||
{
|
||||
var type = Type.GetType(elem.Value);
|
||||
if (type == null && GameMain.LuaCs?.CsScriptLoader?.Assembly != null) type = GameMain.LuaCs.CsScriptLoader.Assembly.GetType(elem.Value);
|
||||
if (type == null) throw new Exception($"Type {elem.Value} not found.");
|
||||
result.Add(type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user