Level cells that overlap with ruins are removed during level generation (instead of just disabling collisions with them), background sprites can spawn on ruin walls

This commit is contained in:
Regalis
2017-03-23 18:13:28 +02:00
parent 885a8c610c
commit e9e4e5f9d3
4 changed files with 68 additions and 41 deletions

View File

@@ -732,7 +732,13 @@ namespace Barotrauma
{
if (MathUtils.GetLineRectangleIntersection(e.point1, e.point2, ruinShape.Rect) != null)
{
cell.CellType = CellType.Empty;
cell.CellType = CellType.Removed;
int x = (int)Math.Floor(cell.Center.X / GridCellSize);
int y = (int)Math.Floor(cell.Center.Y / GridCellSize);
cellGrid[x, y].Remove(cell);
cells.Remove(cell);
break;
}
}