(f417b026f) Fetched: Changes for playing video tutorial from local branch
This commit is contained in:
@@ -10,7 +10,6 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Xml.Linq;
|
||||
using Voronoi2;
|
||||
|
||||
@@ -494,7 +493,7 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 FindSpawnPos(Vector2 spawnPos, Point? submarineSize = null, float subDockingPortOffset = 0.0f)
|
||||
public Vector2 FindSpawnPos(Vector2 spawnPos, Point? submarineSize = null)
|
||||
{
|
||||
Rectangle dockedBorders = GetDockedBorders();
|
||||
Vector2 diffFromDockedBorders =
|
||||
@@ -542,17 +541,17 @@ namespace Barotrauma
|
||||
else if (minX < 0)
|
||||
{
|
||||
//no wall found at the left side, spawn to the left from the right-side wall
|
||||
spawnPos.X = maxX - minWidth - 100.0f + subDockingPortOffset;
|
||||
spawnPos.X = maxX - minWidth - 100.0f;
|
||||
}
|
||||
else if (maxX > Level.Loaded.Size.X)
|
||||
{
|
||||
//no wall found at right side, spawn to the right from the left-side wall
|
||||
spawnPos.X = minX + minWidth + 100.0f + subDockingPortOffset;
|
||||
spawnPos.X = minX + minWidth + 100.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
//walls found at both sides, use their midpoint
|
||||
spawnPos.X = (minX + maxX) / 2 + subDockingPortOffset;
|
||||
spawnPos.X = (minX + maxX) / 2;
|
||||
}
|
||||
|
||||
spawnPos.Y = Math.Min(spawnPos.Y, Level.Loaded.Size.Y - dockedBorders.Height / 2 - 10);
|
||||
|
||||
Reference in New Issue
Block a user