Replace ^ and . in platform paths with ^SupportDir and ^EngineDir.
This commit is contained in:
@@ -63,7 +63,7 @@ namespace OpenRA.FileSystem
|
||||
{
|
||||
// Raw directories are the easiest and one of the most common cases, so try these first
|
||||
var resolvedPath = Platform.ResolvePath(filename);
|
||||
if (!filename.Contains("|") && Directory.Exists(resolvedPath))
|
||||
if (!resolvedPath.Contains("|") && Directory.Exists(resolvedPath))
|
||||
return new Folder(resolvedPath);
|
||||
|
||||
// Children of another package require special handling
|
||||
@@ -295,7 +295,7 @@ namespace OpenRA.FileSystem
|
||||
public static string ResolveAssemblyPath(string path, Manifest manifest, InstalledMods installedMods)
|
||||
{
|
||||
var explicitSplit = path.IndexOf('|');
|
||||
if (explicitSplit > 0)
|
||||
if (explicitSplit > 0 && !path.StartsWith("^"))
|
||||
{
|
||||
var parent = path.Substring(0, explicitSplit);
|
||||
var filename = path.Substring(explicitSplit + 1);
|
||||
|
||||
@@ -188,16 +188,17 @@ namespace OpenRA
|
||||
{
|
||||
path = path.TrimEnd(' ', '\t');
|
||||
|
||||
// Paths starting with ^ are relative to the support dir
|
||||
if (path.StartsWith("^", StringComparison.Ordinal))
|
||||
path = SupportDir + path.Substring(1);
|
||||
if (path == "^SupportDir")
|
||||
return SupportDir;
|
||||
|
||||
// Paths starting with . are relative to the game dir
|
||||
if (path == ".")
|
||||
if (path == "^EngineDir")
|
||||
return EngineDir;
|
||||
|
||||
if (path.StartsWith("./", StringComparison.Ordinal) || path.StartsWith(".\\", StringComparison.Ordinal))
|
||||
path = EngineDir + path.Substring(2);
|
||||
if (path.StartsWith("^SupportDir|", StringComparison.Ordinal))
|
||||
path = SupportDir + path.Substring(12);
|
||||
|
||||
if (path.StartsWith("^EngineDir|", StringComparison.Ordinal))
|
||||
path = EngineDir + path.Substring(11);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user