Load debug symbols for mods if they are loaded from the filesystem

This commit is contained in:
Jean-Rémy Buchs
2017-03-04 12:38:07 +01:00
parent 6fbd6bcb4c
commit d3491c2979

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.Primitives;
@@ -54,7 +55,14 @@ namespace OpenRA
Assembly assembly;
if (!ResolvedAssemblies.TryGetValue(hash, out assembly))
{
assembly = Assembly.Load(data);
using (Stream stream = modFiles.Open(path))
{
if (stream.GetType() == typeof(FileStream))
assembly = Assembly.LoadFile(((FileStream)stream).Name);
else
assembly = Assembly.Load(data);
}
ResolvedAssemblies.Add(hash, assembly);
}