Tutorial fixes

This commit is contained in:
Regalis
2015-10-09 17:18:25 +03:00
parent 4120cabd6e
commit 0a96254696
9 changed files with 42 additions and 24 deletions
+4 -1
View File
@@ -76,7 +76,10 @@ namespace Subsurface
public Vector2 Position
{
get { return ConvertUnits.ToDisplayUnits(cells[0].body.Position); }
get
{
return cells==null ? Vector2.Zero : ConvertUnits.ToDisplayUnits(cells[0].body.Position);
}
}
public List<Vector2> PositionsOfInterest
+5 -3
View File
@@ -623,11 +623,13 @@ namespace Subsurface
loaded = this;
}
public static Submarine Load(string fileName)
public static Submarine Load(string fileName, string folder = SavePath)
{
Unload();
Unload();
Submarine sub = new Submarine(SavePath+"/"+fileName);
string path = string.IsNullOrWhiteSpace(folder) ? fileName : System.IO.Path.Combine(SavePath, fileName);
Submarine sub = new Submarine(path);
sub.Load();
//Entity.dictionary.Add(int.MaxValue, sub);