AICharacte syncing bugfixes, cleanbuild removes the temp save folder, minor networkevent optimizations (enum max value == GetValues().Length-1)

This commit is contained in:
Regalis11
2016-02-21 20:46:57 +02:00
parent 419384188a
commit c613e5fcf8
9 changed files with 97 additions and 82 deletions

View File

@@ -567,17 +567,18 @@ namespace Barotrauma
}
catch (Exception e)
{
DebugConsole.ThrowError("Directory ''" + SavePath + "'' not found and creating the directory failed.", e);
return;
}
}
string[] filePaths;
List<string> filePaths;
string[] subDirectories;
try
{
filePaths = Directory.GetFiles(SavePath);
filePaths = Directory.GetFiles(SavePath).ToList();
subDirectories = Directory.GetDirectories(SavePath);
}
catch (Exception e)
{
@@ -585,6 +586,19 @@ namespace Barotrauma
return;
}
foreach (string subDirectory in subDirectories)
{
try
{
filePaths.AddRange(Directory.GetDirectories(subDirectory));
}
catch (Exception e)
{
DebugConsole.ThrowError("Couldn't open subdirectory ''" + subDirectory + "''!", e);
return;
}
}
foreach (string path in filePaths)
{
//Map savedMap = new Map(mapPath);