Build 0.18.7.0

This commit is contained in:
Markus Isberg
2022-06-08 21:52:38 +09:00
parent 5a10b444ee
commit 4f5a3bf8b9
56 changed files with 401 additions and 245 deletions
@@ -100,13 +100,23 @@ namespace Barotrauma
}
#endif
if (Path.IsPathRooted(originalFilename))
string startPath = directory ?? "";
string saveFolder = SaveUtil.SaveFolder.Replace('\\', '/');
if (originalFilename.Replace('\\', '/').StartsWith(saveFolder))
{
//paths that lead to the save folder might have incorrect case,
//mainly if they come from a filelist
startPath = saveFolder.EndsWith('/') ? saveFolder : $"{saveFolder}/";
filename = startPath;
subDirs = subDirs.Skip(saveFolder.Split('/').Length).ToArray();
}
else if (Path.IsPathRooted(originalFilename))
{
#warning TODO: incorrect assumption or...? Figure out what this was actually supposed to fix, if anything. Might've been a perf thing.
return originalFilename; //assume that rooted paths have correct case since these are generated by the game
}
string startPath = directory ?? "";
for (int i = 0; i < subDirs.Length; i++)
{
if (i == subDirs.Length - 1 && string.IsNullOrEmpty(subDirs[i]))