Skip to content

Commit

Permalink
update SilentSave reference
Browse files Browse the repository at this point in the history
  • Loading branch information
BillyGalbreath committed Oct 25, 2023
1 parent 2dd9f57 commit 743cf5f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions DiscordBot.csproj
Expand Up @@ -53,6 +53,12 @@
<PackageReference Include="YamlDotNet" Version="13.7.1"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SilentSave\SilentSave.csproj">
<Private>false</Private>
</ProjectReference>
</ItemGroup>

<ItemGroup Condition="'$(Configuration)' == 'Release'">
<None Include="LICENSE" CopyToOutputDirectory="PreserveNewest"/>
<None Include="resources/**">
Expand Down
2 changes: 2 additions & 0 deletions DiscordBot.sln
Expand Up @@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscordBot", "DiscordBot.csproj", "{0140C50B-6206-4B47-BB1A-81145337E735}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilentSave", "../SilentSave/SilentSave.csproj", "{FA587D70-D331-4B64-B43C-EBE335223B5C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
7 changes: 2 additions & 5 deletions src/Bot.cs
@@ -1,6 +1,5 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Discord;
Expand All @@ -10,7 +9,7 @@
using DiscordBot.Config;
using DiscordBot.Extensions;
using DiscordBot.Util;
using HarmonyLib;
using SilentSave;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
Expand Down Expand Up @@ -202,9 +201,7 @@ public class Bot {
}

private void OnLoggerEntryAdded(EnumLogType logType, string message, object[] args) {
if (!(bool)(AccessTools.TypeByName("SilentSave.SilentSaveMod")?
.GetField("allowLogger", BindingFlags.NonPublic | BindingFlags.Static)?
.GetValue(null) ?? true)) {
if (Api.ModLoader.GetModSystem<SilentSaveMod?>()?.SaveInProgress() ?? false) {
return;
}

Expand Down

0 comments on commit 743cf5f

Please sign in to comment.