Potential fix for the wrong publicized folder being loaded
This commit is contained in:
@@ -53,6 +53,18 @@ namespace Barotrauma
|
||||
public const bool IsClient = true;
|
||||
#endif
|
||||
|
||||
public static bool IsRunningInsideWorkshop
|
||||
{
|
||||
get
|
||||
{
|
||||
#if SERVER
|
||||
return Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) == Directory.GetCurrentDirectory();
|
||||
#else
|
||||
return false; // unnecessary but just keeps things clear that this is NOT for client stuff
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private static int executionNumber = 0;
|
||||
|
||||
|
||||
|
||||
@@ -334,10 +334,12 @@ public sealed class CsPackageManager : IDisposable
|
||||
|
||||
void GetFiles(List<string> list, string searchQuery)
|
||||
{
|
||||
bool workshopFirst = _luaCsSetup.Config.PreferToUseWorkshopLuaSetup || LuaCsSetup.IsRunningInsideWorkshop;
|
||||
|
||||
var publicizedDir = Path.Combine(Environment.CurrentDirectory, "Publicized");
|
||||
|
||||
// if using workshop lua setup is checked, try to use the publicized assemblies in the content package there instead.
|
||||
if (_luaCsSetup.Config.PreferToUseWorkshopLuaSetup)
|
||||
if (workshopFirst)
|
||||
{
|
||||
var pck = LuaCsSetup.GetPackage(LuaCsSetup.LuaForBarotraumaId);
|
||||
if (pck is not null)
|
||||
@@ -353,7 +355,7 @@ public sealed class CsPackageManager : IDisposable
|
||||
// no directory found, use the other one
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
if (_luaCsSetup.Config.PreferToUseWorkshopLuaSetup)
|
||||
if (workshopFirst)
|
||||
{
|
||||
ModUtils.Logging.PrintError($"Unable to find <LuaCsPackage>/Binary/Publicized/ . Using Game folder instead.");
|
||||
publicizedDir = Path.Combine(Environment.CurrentDirectory, "Publicized");
|
||||
|
||||
Reference in New Issue
Block a user