Removed duplicate "MapEntity.MapLoaded" call from level generation, fixed level walls occasionally overlapping with ruins

This commit is contained in:
Regalis
2017-03-25 20:13:15 +02:00
parent aca85c2708
commit 52dde81396
+4 -5
View File
@@ -473,10 +473,7 @@ namespace Barotrauma
//initialize MapEntities that aren't in any sub (e.g. items inside ruins)
MapEntity.MapLoaded(null);
//initialize MapEntities that aren't in any sub (e.g. items inside ruins)
MapEntity.MapLoaded(null);
Debug.WriteLine("Generatelevel: " + sw2.ElapsedMilliseconds + " ms");
sw2.Restart();
@@ -733,7 +730,9 @@ namespace Barotrauma
if (cell.CellType == CellType.Empty) continue;
foreach (GraphEdge e in cell.edges)
{
if (MathUtils.GetLineRectangleIntersection(e.point1, e.point2, ruinShape.Rect) != null)
Rectangle rect = ruinShape.Rect;
rect.Y += rect.Height;
if (MathUtils.GetLineRectangleIntersection(e.point1, e.point2, rect) != null)
{
cell.CellType = CellType.Removed;