Removed duplicate "MapEntity.MapLoaded" call from level generation, fixed level walls occasionally overlapping with ruins
This commit is contained in:
@@ -473,10 +473,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
//initialize MapEntities that aren't in any sub (e.g. items inside ruins)
|
//initialize MapEntities that aren't in any sub (e.g. items inside ruins)
|
||||||
MapEntity.MapLoaded(null);
|
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");
|
Debug.WriteLine("Generatelevel: " + sw2.ElapsedMilliseconds + " ms");
|
||||||
sw2.Restart();
|
sw2.Restart();
|
||||||
|
|
||||||
@@ -733,7 +730,9 @@ namespace Barotrauma
|
|||||||
if (cell.CellType == CellType.Empty) continue;
|
if (cell.CellType == CellType.Empty) continue;
|
||||||
foreach (GraphEdge e in cell.edges)
|
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;
|
cell.CellType = CellType.Removed;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user