Skip to content

Commit

Permalink
2.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 23, 2024
1 parent 2d92bf3 commit f9a69bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion GDWeave/GDWeave.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Version>2.0.5.0</Version>
<Version>2.0.6.0</Version>

<!-- required for loader -->
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand Down
2 changes: 1 addition & 1 deletion GDWeave/Godot/Variants/NilVariant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace GDWeave.Godot.Variants;
// Why does this exist
public class NilVariant : Variant {
public NilVariant(VariantParser.ParserReaderContext ctx) { }
private NilVariant() { }
public NilVariant() { }

public override void Write(VariantParser.ParserWriterContext ctx) {
ctx.WriteType(VariantType.Nil);
Expand Down
17 changes: 1 addition & 16 deletions GDWeave/Loader/ModLoadContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,7 @@ protected override Assembly Load(AssemblyName assemblyName) {
var assemblyPath = this.resolver.ResolveAssemblyToPath(assemblyName);
if (assemblyPath is null) return null!;

// FASM moment
return assemblyPath.Contains("Reloaded")
? this.LoadFromAssemblyPath(assemblyPath)
: this.LoadFromFile(assemblyPath);
}

public Assembly LoadFromFile(string path) {
var symbols = path.Replace(".dll", ".pdb");
if (File.Exists(symbols)) {
return this.LoadFromStream(
new MemoryStream(File.ReadAllBytes(path)),
new MemoryStream(File.ReadAllBytes(symbols))
);
} else {
return this.LoadFromStream(new MemoryStream(File.ReadAllBytes(path)));
}
return this.LoadFromAssemblyPath(assemblyPath);
}

protected override nint LoadUnmanagedDll(string unmanagedDllName) {
Expand Down
2 changes: 1 addition & 1 deletion GDWeave/Loader/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void Sort() {
private IMod? LoadAssembly(string id, string assemblyPath) {
var fullAssemblyPath = Path.GetFullPath(assemblyPath);
var context = new ModLoadContext(fullAssemblyPath);
var assembly = context.LoadFromFile(fullAssemblyPath);
var assembly = context.LoadFromAssemblyPath(fullAssemblyPath);
var modType = assembly.GetTypes().FirstOrDefault(t =>
t.GetInterfaces().FirstOrDefault(t => t.FullName == typeof(IMod).FullName) != null);

Expand Down

0 comments on commit f9a69bc

Please sign in to comment.