- RepairTools work for structures that are outside the submarine

- Ruins are visible in sonar
- Fixed ruin generation algorithm occasionally creating too narrow rooms and placing corridors so that they're blocked by corners of a room
- Fix for wall textures being misaligned for map cells with no physics body
This commit is contained in:
Regalis
2016-05-03 00:14:52 +03:00
parent 2c76a6ad3c
commit 09e8b8b9c6
6 changed files with 128 additions and 87 deletions
@@ -28,6 +28,11 @@ namespace Barotrauma.RuinGeneration
protected set;
}
public Vector2 Center
{
get { return rect.Center.ToVector2(); }
}
public List<Line> Walls;
public virtual void CreateWalls() { }
@@ -170,6 +175,11 @@ namespace Barotrauma.RuinGeneration
get { return allShapes; }
}
public List<Line> Walls
{
get { return walls; }
}
public Rectangle Area
{
get;
@@ -207,7 +217,7 @@ namespace Barotrauma.RuinGeneration
for (int i = 0; i < iterations; i++)
{
rooms.ForEach(l => l.Split(0.3f, verticalProbability));
rooms.ForEach(l => l.Split(0.3f, verticalProbability, 300));
rooms = baseRoom.GetLeaves();
}
@@ -340,6 +350,11 @@ namespace Barotrauma.RuinGeneration
(int)((wall.B.X - wall.A.X) + radius*2.0f),
(int)((wall.B.Y - wall.A.Y) + radius*2.0f));
if (wall.A.Y == wall.B.Y)
{
rect.Inflate(-32, 0);
}
var structure = new Structure(rect, structurePrefab.Prefab as StructurePrefab, null);
structure.MoveWithLevel = true;
structure.SetCollisionCategory(Physics.CollisionLevel);