Another docking port fix: EntityGrids are made slightly larger than the borders of the submarine, because docking ports may create gaps and hulls outside the borders, causing FindHull to fail and characters to get teleported outside the sub when from sub to another. Closes #551, hopefully for good now!

This commit is contained in:
Joonas Rikkonen
2018-08-29 14:50:44 +03:00
parent 8d83580b75
commit 7eed555522
@@ -16,7 +16,15 @@ namespace Barotrauma
public EntityGrid(Submarine submarine, float cellSize)
{
this.limits = submarine.Borders;
//make the grid slightly larger than the borders of the submarine,
//because docking ports may create gaps and hulls outside the borders
int padding = 128;
this.limits = new Rectangle(
submarine.Borders.X - padding,
submarine.Borders.Y + padding,
submarine.Borders.Width + padding * 2,
submarine.Borders.Height + padding * 2);
this.Submarine = submarine;
this.cellSize = cellSize;