Remove Platform.IsPathRelativeToSupportDirectory.

This commit is contained in:
Paul Chote
2020-11-20 17:56:47 +00:00
committed by abcdefg30
parent 888915b53b
commit 151cea96e9
2 changed files with 9 additions and 21 deletions

View File

@@ -72,13 +72,10 @@ namespace OpenRA
try
{
// HACK: If the path is inside the the support directory then we may need to create it
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);
if (!File.Exists(resolved))
Directory.CreateDirectory(resolved);
}
// Assume that the path is a directory if there is not an existing file with the same name
var resolved = Platform.ResolvePath(name);
if (resolved.StartsWith(Platform.SupportDir) && !File.Exists(resolved))
Directory.CreateDirectory(resolved);
package = modData.ModFiles.OpenPackage(name);
}
@@ -144,12 +141,9 @@ namespace OpenRA
name = name.Substring(1);
// Don't try to open the map directory in the support directory if it doesn't exist
if (Platform.IsPathRelativeToSupportDirectory(name))
{
var resolved = Platform.ResolvePath(name);
if (!Directory.Exists(resolved) || !File.Exists(resolved))
continue;
}
var resolved = Platform.ResolvePath(name);
if (resolved.StartsWith(Platform.SupportDir) && (!Directory.Exists(resolved) || !File.Exists(resolved)))
continue;
using (var package = (IReadWritePackage)modData.ModFiles.OpenPackage(name))
{