Create SupportDirPrefix and IsPathRelativeToSupportDirectory() as members on Platform class.
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OpenRA
|
||||
try
|
||||
{
|
||||
// HACK: If the path is inside the the support directory then we may need to create it
|
||||
if (name.StartsWith("^", StringComparison.Ordinal))
|
||||
if (Platform.IsPathRelativeToSupportDirectory(name))
|
||||
{
|
||||
// Assume that the path is a directory if there is not an existing file with the same name
|
||||
var resolved = Platform.ResolvePath(name);
|
||||
@@ -144,7 +144,7 @@ namespace OpenRA
|
||||
name = name.Substring(1);
|
||||
|
||||
// Don't try to open the map directory in the support directory if it doesn't exist
|
||||
if (name.StartsWith("^", StringComparison.Ordinal))
|
||||
if (Platform.IsPathRelativeToSupportDirectory(name))
|
||||
{
|
||||
var resolved = Platform.ResolvePath(name);
|
||||
if (!Directory.Exists(resolved) || !File.Exists(resolved))
|
||||
|
||||
Reference in New Issue
Block a user