- 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
+4 -5
View File
@@ -319,7 +319,7 @@ namespace Barotrauma
rect = newRect;
FindHull();
if (submarine==null || !submarine.Loading) FindHull();
condition = 100.0f;
@@ -474,7 +474,7 @@ namespace Barotrauma
ic.Move(amount);
}
if (body != null) FindHull();
if (body != null && (Submarine==null || !Submarine.Loading)) FindHull();
}
public Rectangle TransformTrigger(Rectangle trigger, bool world = false)
@@ -512,11 +512,10 @@ namespace Barotrauma
CurrentHull = Hull.FindHull(WorldPosition, CurrentHull);
if (body!=null)
{
body.Submarine = CurrentHull == null ? null : Submarine.Loaded;
Submarine = CurrentHull == null ? null : Submarine.Loaded;
body.Submarine = Submarine;
}
return CurrentHull;
}