The wall at the top of the level is visible in sonars

This commit is contained in:
Regalis
2016-05-11 20:23:03 +03:00
parent 11e4f5699f
commit aaa84ef4ac
@@ -163,10 +163,17 @@ namespace Barotrauma.Items.Components
} }
if (Level.Loaded != null && (item.CurrentHull==null || !DetectSubmarineWalls)) if (Level.Loaded != null && (item.CurrentHull == null || !DetectSubmarineWalls))
{ {
List<VoronoiCell> cells = Level.Loaded.GetCells(item.WorldPosition, 7); if (Level.Loaded.Size.Y - item.WorldPosition.Y < range)
{
CreateBlipsForLine(
new Vector2(item.WorldPosition.X - range, Level.Loaded.Size.Y),
new Vector2(item.WorldPosition.X + range, Level.Loaded.Size.Y),
radius, displayScale, 1.0f);
}
List<VoronoiCell> cells = Level.Loaded.GetCells(item.WorldPosition, 7);
foreach (VoronoiCell cell in cells) foreach (VoronoiCell cell in cells)
{ {
foreach (GraphEdge edge in cell.edges) foreach (GraphEdge edge in cell.edges)
@@ -183,7 +190,7 @@ namespace Barotrauma.Items.Components
} }
} }
foreach(RuinGeneration.Ruin ruin in Level.Loaded.Ruins) foreach (RuinGeneration.Ruin ruin in Level.Loaded.Ruins)
{ {
if (!MathUtils.CircleIntersectsRectangle(item.WorldPosition, range, ruin.Area)) continue; if (!MathUtils.CircleIntersectsRectangle(item.WorldPosition, range, ruin.Area)) continue;