From 2b0c5c13ff771db2cc086a842d4534e7eb3dc7a1 Mon Sep 17 00:00:00 2001 From: Dmitry Balabanov Date: Sun, 24 Jun 2018 15:55:19 +0200 Subject: [PATCH] Add the Steam Workshop ID --- src/RealTime/Core/RealTimeMod.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RealTime/Core/RealTimeMod.cs b/src/RealTime/Core/RealTimeMod.cs index 9843a99e..b9be182a 100644 --- a/src/RealTime/Core/RealTimeMod.cs +++ b/src/RealTime/Core/RealTimeMod.cs @@ -21,6 +21,8 @@ namespace RealTime.Core /// public sealed class RealTimeMod : LoadingExtensionBase, IUserMod { + private const long WorkshopId = 1420955187; + private readonly string modVersion = GitVersion.GetAssemblyVersion(typeof(RealTimeMod).Assembly); private readonly string modPath = GetModPath(); @@ -119,8 +121,10 @@ public override void OnLevelUnloading() private static string GetModPath() { + string assemblyName = typeof(RealTimeMod).Assembly.GetName().Name; + PluginManager.PluginInfo pluginInfo = PluginManager.instance.GetPluginsInfo() - .FirstOrDefault(pi => pi.name == typeof(RealTimeMod).Assembly.GetName().Name); + .FirstOrDefault(pi => pi.name == assemblyName || pi.publishedFileID.AsUInt64 == WorkshopId); return pluginInfo == null ? Environment.CurrentDirectory