Unstable 0.17.3.0
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using Barotrauma.IO;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
sealed class ServerExecutableFile : OtherFile
|
||||
{
|
||||
//This content type doesn't do very much on its own, it's handled manually by the Host Server menu
|
||||
public ServerExecutableFile(ContentPackage contentPackage, ContentPath path) : base(contentPackage, path) { }
|
||||
|
||||
public static ContentPath MutateContentPath(ContentPath path)
|
||||
{
|
||||
if (File.Exists(path.FullPath)) { return path; }
|
||||
|
||||
string rawValueWithoutExtension()
|
||||
=> Barotrauma.IO.Path.Combine(
|
||||
Barotrauma.IO.Path.GetDirectoryName(path.RawValue ?? ""),
|
||||
Barotrauma.IO.Path.GetFileNameWithoutExtension(path.RawValue ?? "")).CleanUpPath();
|
||||
|
||||
path = ContentPath.FromRaw(path.ContentPackage, rawValueWithoutExtension());
|
||||
if (File.Exists(path.FullPath)) { return path; }
|
||||
|
||||
path = ContentPath.FromRaw(path.ContentPackage,
|
||||
rawValueWithoutExtension() + ".exe");
|
||||
return path;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user