Taking structure offset from origin into account when spawning the sub, repairtool automatically targets last section if welding the second-to-last

This commit is contained in:
Regalis
2016-02-20 14:12:04 +02:00
parent 058a269ecb
commit 8672a47a12
5 changed files with 19 additions and 10 deletions
+4 -1
View File
@@ -119,7 +119,10 @@ namespace Barotrauma
if (level != null)
{
level.Generate();
submarine.SetPosition(level.StartPosition - new Vector2(0.0f, 2000.0f));
Vector2 subOffsetFromCenter = new Vector2(Submarine.Borders.Center.X, Submarine.Borders.Y - Submarine.Borders.Height / 2);
submarine.SetPosition(level.StartPosition - subOffsetFromCenter - new Vector2(0.0f, 2000.0f));
GameMain.GameScreen.BackgroundCreatureManager.SpawnSprites(80);
}