Skip to content

Commit 461e91a

Browse files
committed
Fix compilation timeout when reloading plugins utilising //Requires
1 parent bac938b commit 461e91a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/Compilation.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,18 @@ internal void Prepare(Action callback)
168168
RemovePlugin(plugin);
169169
}
170170

171-
if (pluginsToAdd.Contains(plugin))
171+
if (!pluginsToAdd.Contains(plugin))
172+
{
173+
pluginsToAdd.Add(plugin);
174+
175+
PreparseScript(plugin);
176+
ResolveReferences(plugin);
177+
}
178+
else
172179
{
173180
Interface.Oxide.RootLogger.WriteDebug(LogType.Error, LogEvent.Compile, "CSharp", $"Plugin is already part of the compilation: {plugin.Name}");
174-
continue;
175181
}
176182

177-
pluginsToAdd.Add(plugin);
178-
179-
PreparseScript(plugin);
180-
ResolveReferences(plugin);
181-
182183
CacheModifiedScripts();
183184

184185
// We don't want the main thread to be able to add more plugins which could be missed

0 commit comments

Comments
 (0)