From 41d39080adbaafd0bb23d52fca9ed7fe68143649 Mon Sep 17 00:00:00 2001 From: Triceraptodactyl Date: Tue, 24 Apr 2018 21:48:54 +0200 Subject: [PATCH] =?UTF-8?q?An=20Den=20T=C3=BCren=20werden=20die=20W=C3=A4n?= =?UTF-8?q?de=20des=20Raums=20korrekt=20angezeigt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Die Wände der Gänge an der selben Stelle müssen noch entfernt werden --- .../Scripts/Generation/GenerationProcessor.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/Generation/GenerationProcessor.cs b/Assets/Scripts/Generation/GenerationProcessor.cs index c41af0f..1e0f684 100644 --- a/Assets/Scripts/Generation/GenerationProcessor.cs +++ b/Assets/Scripts/Generation/GenerationProcessor.cs @@ -73,7 +73,7 @@ public class GenerationProcessor { } private ExtendedTileType GetCorrectWallType(Dictionary tiles, Vector2Int position) { - int groundNumber = CountSpecificNeighbours(tiles, position, Room.TileType.GROUND) + CountSpecificNeighbours(tiles, position, Room.TileType.ROCK); + int groundNumber = CountSpecificNeighbours(tiles, position, Room.TileType.GROUND) + CountSpecificNeighbours(tiles, position, Room.TileType.ROCK) + CountSpecificNeighbours(tiles, position, Room.TileType.DOOR); switch ( groundNumber ) { case 0: return ExtendedTileType.BorderInner; @@ -117,17 +117,17 @@ public class GenerationProcessor { case ExtendedTileType.BorderOuter: Vector2Int toCheck1 = v + new Vector2Int(0, -1); Vector2Int toCheck2 = v + new Vector2Int(-1, 0); - if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type == Room.TileType.WALL && tiles[toCheck2].type == Room.TileType.WALL) - return 90; - toCheck1 = v + new Vector2Int(0, 1); - if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type == Room.TileType.WALL && tiles[toCheck2].type == Room.TileType.WALL) - return 0; - toCheck2 = v + new Vector2Int(1, 0); - if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type == Room.TileType.WALL && tiles[toCheck2].type == Room.TileType.WALL) + if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type != Room.TileType.WALL && tiles[toCheck2].type != Room.TileType.WALL) return 270; - toCheck1 = v + new Vector2Int(0, -1); - if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type == Room.TileType.WALL && tiles[toCheck2].type == Room.TileType.WALL) + toCheck1 = v + new Vector2Int(0, 1); + if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type != Room.TileType.WALL && tiles[toCheck2].type != Room.TileType.WALL) return 180; + toCheck2 = v + new Vector2Int(1, 0); + if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type != Room.TileType.WALL && tiles[toCheck2].type != Room.TileType.WALL) + return 90; + toCheck1 = v + new Vector2Int(0, -1); + if(tiles.ContainsKey(toCheck1) && tiles.ContainsKey(toCheck2) && tiles[toCheck1].type != Room.TileType.WALL && tiles[toCheck2].type != Room.TileType.WALL) + return 0; break; } return 0;