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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user