diff --git a/OpenRA.Game/Map/MapCache.cs b/OpenRA.Game/Map/MapCache.cs index b54151262c..70fefbaa93 100644 --- a/OpenRA.Game/Map/MapCache.cs +++ b/OpenRA.Game/Map/MapCache.cs @@ -54,12 +54,21 @@ namespace OpenRA ? MapClassification.Unknown : Enum.Parse(kv.Value); IReadOnlyPackage package; - var optional = name.StartsWith("~"); + var optional = name.StartsWith("~", StringComparison.Ordinal); if (optional) name = name.Substring(1); try { + // HACK: If the path is inside the the support directory then we may need to create it + if (name.StartsWith("^", StringComparison.Ordinal)) + { + // 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); + } + package = modData.ModFiles.OpenPackage(name); } catch