Submarine saving fixes, impact damage in sub-sub collisions, submarine ambient sounds

This commit is contained in:
Regalis
2016-06-12 14:23:08 +03:00
parent 495a0f4124
commit cf822cfae6
7 changed files with 80 additions and 48 deletions
+5 -7
View File
@@ -526,7 +526,7 @@ namespace Barotrauma
foreach (MapEntity e in MapEntity.mapEntityList)
{
if (e.MoveWithLevel) continue;
if (e.MoveWithLevel ||e.Submarine != this) continue;
e.Save(doc);
}
@@ -548,17 +548,15 @@ namespace Barotrauma
public static bool SaveCurrent(string filePath)
{
if (!loaded.Any())
if (Submarine.MainSub == null)
{
loaded.Add(new Submarine(filePath));
Submarine.MainSub = new Submarine(filePath);
// return;
}
System.Diagnostics.Debug.Assert(loaded.Count==1);
Submarine.MainSub.filePath = filePath;
loaded.First().filePath = filePath;
return loaded.First().SaveAs(filePath);
return Submarine.MainSub.SaveAs(filePath);
}
public void CheckForErrors()