- disabled unnecessary hull updates during loading (items/gaps find the hull when everything is loaded instead of every time a hull is created or moved)

- fixed item.Submarine not being set in item.FindHull
This commit is contained in:
Regalis11
2016-05-14 23:01:57 +03:00
parent d884f84346
commit c546c42a8b
5 changed files with 47 additions and 24 deletions
+16 -1
View File
@@ -71,6 +71,12 @@ namespace Barotrauma
get { return lastPickedFraction; }
}
public bool Loading
{
get;
private set;
}
public bool GodMode
{
get;
@@ -676,7 +682,8 @@ namespace Barotrauma
public void Load()
{
Unload();
//string file = filePath;
Loading = true;
XDocument doc = OpenDoc(filePath);
if (doc == null || doc.Root == null) return;
@@ -758,6 +765,14 @@ namespace Barotrauma
loaded = this;
Hull.GenerateEntityGrid();
for (int i = 0; i < MapEntity.mapEntityList.Count; i++)
{
if (MapEntity.mapEntityList[i].Submarine != this) continue;
MapEntity.mapEntityList[i].Move(HiddenSubPosition);
}
Loading = false;
MapEntity.MapLoaded();