add save folder to whitelist

This commit is contained in:
EvilFactory
2022-08-11 12:59:20 -03:00
parent 6c7a93d53e
commit 53c586b22f
2 changed files with 10 additions and 8 deletions
@@ -14,6 +14,7 @@ namespace Barotrauma
{ {
public bool IsSingleplayer => GameMain.IsSingleplayer; public bool IsSingleplayer => GameMain.IsSingleplayer;
public bool IsMultiplayer => GameMain.IsMultiplayer; public bool IsMultiplayer => GameMain.IsMultiplayer;
public string SaveFolder => SaveUtil.SaveFolder;
#if CLIENT #if CLIENT
public GameClient Client public GameClient Client
@@ -22,7 +23,7 @@ namespace Barotrauma
{ {
return GameMain.Client; return GameMain.Client;
} }
} }
public bool? ForceVoice = null; public bool? ForceVoice = null;
public bool? ForceLocalVoice = null; public bool? ForceLocalVoice = null;
@@ -1,4 +1,4 @@
using Barotrauma.Items.Components; using Barotrauma.Items.Components;
using Barotrauma.Networking; using Barotrauma.Networking;
using MoonSharp.Interpreter; using MoonSharp.Interpreter;
using System; using System;
@@ -55,18 +55,19 @@ namespace Barotrauma
bool pathStartsWith(string prefix) => path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase); bool pathStartsWith(string prefix) => path.StartsWith(prefix, StringComparison.OrdinalIgnoreCase);
if (pathStartsWith(getFullPath(ContentPackage.LocalModsDir + "Lua For Barotrauma")))
if (pathStartsWith(getFullPath(ContentPackage.LocalModsDir + "LuaForBarotraumaUnstable")))
return false; return false;
if (pathStartsWith(getFullPath(ContentPackage.WorkshopModsDir + "LuaForBarotraumaUnstable"))) if (pathStartsWith(getFullPath(ContentPackage.WorkshopModsDir + "Lua For Barotrauma")))
return false; return false;
#if CLIENT #if CLIENT
if (pathStartsWith(getFullPath(ModReceiver.DownloadFolder + "LuaForBarotraumaUnstable"))) if (pathStartsWith(getFullPath(ModReceiver.DownloadFolder + "Lua For Barotrauma")))
return false; return false;
#endif #endif
if (pathStartsWith(getFullPath(SaveUtil.SaveFolder)))
return true;
if (pathStartsWith(getFullPath(ContentPackage.LocalModsDir))) if (pathStartsWith(getFullPath(ContentPackage.LocalModsDir)))
return true; return true;
if (pathStartsWith(getFullPath(ContentPackage.WorkshopModsDir))) if (pathStartsWith(getFullPath(ContentPackage.WorkshopModsDir)))
@@ -514,4 +515,4 @@ namespace Barotrauma
using (var file = LuaCsFile.OpenWrite(path)) Save(file, obj); using (var file = LuaCsFile.OpenWrite(path)) Save(file, obj);
} }
} }
} }