From f999001cafd85d6d446a2eaff25d5eb3408b67e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-R=C3=A9my=20Buchs?= Date: Tue, 7 Mar 2017 18:30:08 +0100 Subject: [PATCH] Load debug symbols (.mdb on mono only; .pdb) for mods if they are present --- OpenRA.Game/ObjectCreator.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/ObjectCreator.cs b/OpenRA.Game/ObjectCreator.cs index f22dca37cb..5db2276be4 100644 --- a/OpenRA.Game/ObjectCreator.cs +++ b/OpenRA.Game/ObjectCreator.cs @@ -56,9 +56,9 @@ namespace OpenRA if (!ResolvedAssemblies.TryGetValue(hash, out assembly)) { Stream debugStream = null; - if (modFiles.TryOpen(path + ".mdb", out debugStream)) + if (Type.GetType("Mono.Runtime") != null && modFiles.TryOpen(path + ".mdb", out debugStream)) assembly = Assembly.Load(data, debugStream.ReadAllBytes()); - else if (modFiles.TryOpen(path + ".pdb", out debugStream)) + else if (modFiles.TryOpen(path.Substring(0, path.Length - 4) + ".pdb", out debugStream)) assembly = Assembly.Load(data, debugStream.ReadAllBytes()); else assembly = Assembly.Load(data);