@@ -45,7 +45,7 @@ internal Compilation(int id, Action<Compilation> callback, CompilablePlugin[] pl
4545
4646 foreach ( CompilablePlugin plugin in plugins )
4747 {
48- plugin . CompilerErrors = null ;
48+ plugin . CompilerErrors . Clear ( ) ;
4949 plugin . OnCompilationStarted ( ) ;
5050 }
5151
@@ -77,7 +77,7 @@ internal void Add(CompilablePlugin plugin)
7777 }
7878
7979 plugin . Loader . PluginLoadingStarted ( plugin ) ;
80- plugin . CompilerErrors = null ;
80+ plugin . CompilerErrors . Clear ( ) ;
8181 plugin . OnCompilationStarted ( ) ;
8282
8383 foreach ( Core . Plugins . Plugin pl in Interface . Oxide . RootPluginManager . GetPlugins ( ) . Where ( pl => pl is CSharpPlugin ) )
@@ -100,7 +100,7 @@ internal bool IncludesRequiredPlugin(string name)
100100 }
101101
102102 CompilablePlugin compilablePlugin = plugins . SingleOrDefault ( pl => pl . Name == name ) ;
103- return compilablePlugin != null && compilablePlugin . CompilerErrors == null ;
103+ return compilablePlugin is { CompilerErrors . Count : 0 } ;
104104 }
105105
106106 internal void Prepare ( Action callback )
@@ -221,7 +221,7 @@ private void PreparseScript(CompilablePlugin plugin)
221221 if ( line . IndexOf ( "namespace uMod.Plugins" , StringComparison . InvariantCultureIgnoreCase ) >= 0 )
222222 {
223223 Interface . Oxide . LogError ( $ "Plugin { plugin . ScriptName } .cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.") ;
224- plugin . CompilerErrors = $ "Plugin { plugin . ScriptName } .cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.";
224+ plugin . CompilerErrors . Add ( $ "Plugin { plugin . ScriptName } .cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.") ;
225225 RemovePlugin ( plugin ) ;
226226 return ;
227227 }
@@ -259,7 +259,7 @@ private void PreparseScript(CompilablePlugin plugin)
259259 if ( className != plugin . Name )
260260 {
261261 Interface . Oxide . LogError ( $ "Plugin filename { plugin . ScriptName } .cs must match the main class { className } (should be { className } .cs)") ;
262- plugin . CompilerErrors = $ "Plugin filename { plugin . ScriptName } .cs must match the main class { className } (should be { className } .cs)";
262+ plugin . CompilerErrors . Add ( $ "Plugin filename { plugin . ScriptName } .cs must match the main class { className } (should be { className } .cs)") ;
263263 RemovePlugin ( plugin ) ;
264264 }
265265
@@ -275,7 +275,7 @@ private void PreparseScript(CompilablePlugin plugin)
275275 if ( ! File . Exists ( Path . Combine ( plugin . Directory , dependencyName + ".cs" ) ) )
276276 {
277277 Interface . Oxide . LogError ( $ "{ plugin . Name } plugin requires missing dependency: { dependencyName } ") ;
278- plugin . CompilerErrors = $ "Missing dependency: { dependencyName } ";
278+ plugin . CompilerErrors . Add ( $ "Missing dependency: { dependencyName } ") ;
279279 RemovePlugin ( plugin ) ;
280280 return ;
281281 }
@@ -360,7 +360,7 @@ private void ResolveReferences(CompilablePlugin plugin)
360360
361361 string message = $ "{ fullName } is referenced by { plugin . Name } plugin but is not loaded";
362362 Interface . Oxide . LogError ( message ) ;
363- plugin . CompilerErrors = message ;
363+ plugin . CompilerErrors . Add ( message ) ;
364364 RemovePlugin ( plugin ) ;
365365 }
366366 }
@@ -401,7 +401,7 @@ private void AddReference(CompilablePlugin plugin, string assemblyNameString)
401401 }
402402
403403 Interface . Oxide . LogError ( $ "Assembly referenced by { plugin . Name } plugin does not exist: { assemblyNameString } .dll") ;
404- plugin . CompilerErrors = $ "Referenced assembly does not exist: { assemblyNameString } ";
404+ plugin . CompilerErrors . Add ( $ "Referenced assembly does not exist: { assemblyNameString } ") ;
405405 RemovePlugin ( plugin ) ;
406406 return ;
407407 }
@@ -414,7 +414,7 @@ private void AddReference(CompilablePlugin plugin, string assemblyNameString)
414414 catch ( FileNotFoundException )
415415 {
416416 Interface . Oxide . LogError ( $ "Assembly referenced by { plugin . Name } plugin is invalid: { assemblyNameString } .dll") ;
417- plugin . CompilerErrors = $ "Referenced assembly is invalid: { assemblyNameString } ";
417+ plugin . CompilerErrors . Add ( $ "Referenced assembly is invalid: { assemblyNameString } ") ;
418418 RemovePlugin ( plugin ) ;
419419 return ;
420420 }
@@ -466,7 +466,7 @@ private bool CacheScriptLines(CompilablePlugin plugin)
466466 if ( ! File . Exists ( plugin . ScriptPath ) )
467467 {
468468 Interface . Oxide . LogWarning ( "Script no longer exists: {0}" , plugin . Name ) ;
469- plugin . CompilerErrors = "Plugin file was deleted" ;
469+ plugin . CompilerErrors . Add ( "Plugin file was deleted" ) ;
470470 RemovePlugin ( plugin ) ;
471471 return false ;
472472 }
0 commit comments