translate ^ and ~ as FileSystem.Mount does

This commit is contained in:
Matthias Mailänder
2013-10-12 11:05:09 +02:00
parent 166b727c0b
commit c87c4cfda2

View File

@@ -34,6 +34,14 @@ namespace OpenRA
{
string[] noMaps = { };
// ignore optional flag
if (dir.StartsWith("~"))
dir = dir.Substring(1);
// paths starting with ^ are relative to the user directory
if (dir.StartsWith("^"))
dir = Platform.SupportDir + dir.Substring(1);
if (!Directory.Exists(dir))
return noMaps;