From 52dde813960c2028e42b73c34184d83b9b7490c2 Mon Sep 17 00:00:00 2001 From: Regalis Date: Sat, 25 Mar 2017 20:13:15 +0200 Subject: [PATCH] Removed duplicate "MapEntity.MapLoaded" call from level generation, fixed level walls occasionally overlapping with ruins --- Subsurface/Source/Map/Levels/Level.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Subsurface/Source/Map/Levels/Level.cs b/Subsurface/Source/Map/Levels/Level.cs index ca69f92ab..ee672d5db 100644 --- a/Subsurface/Source/Map/Levels/Level.cs +++ b/Subsurface/Source/Map/Levels/Level.cs @@ -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;