Build 0.18.7.0
This commit is contained in:
@@ -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]))
|
||||
|
||||
Reference in New Issue
Block a user