From c87c4cfda28906dda1f6cb48f765b10a16d824b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 12 Oct 2013 11:05:09 +0200 Subject: [PATCH] translate ^ and ~ as FileSystem.Mount does --- OpenRA.Game/ModData.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/OpenRA.Game/ModData.cs b/OpenRA.Game/ModData.cs index 917e5de733..ed67ec49c2 100755 --- a/OpenRA.Game/ModData.cs +++ b/OpenRA.Game/ModData.cs @@ -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;