From 60c6ff317b773d6263097095da42179def690b44 Mon Sep 17 00:00:00 2001 From: Triceraptodactyl Date: Mon, 23 Apr 2018 01:21:35 +0200 Subject: [PATCH] Rock Wall Fix --- Assets/Scripts/Generation/GenerationProcessor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/Generation/GenerationProcessor.cs b/Assets/Scripts/Generation/GenerationProcessor.cs index 1f50f79..e1ed890 100644 --- a/Assets/Scripts/Generation/GenerationProcessor.cs +++ b/Assets/Scripts/Generation/GenerationProcessor.cs @@ -106,7 +106,7 @@ public class GenerationProcessor { } private ExtendedTileType getCorrectWallType(Dictionary tiles, Vector2Int position){ - int groundNumber = CountSpecificNeighbours(tiles, position, Room.TileType.GROUND); + int groundNumber = CountSpecificNeighbours(tiles, position, Room.TileType.GROUND) + CountSpecificNeighbours(tiles, position, Room.TileType.ROCK); switch(groundNumber){ case 0: return ExtendedTileType.BorderInner; @@ -118,14 +118,14 @@ public class GenerationProcessor { } private ExtendedTileType getCorrectRockType(Dictionary tiles, Vector2Int position){ - + ExtendedTileType type = ExtendedTileType.Rock; bool left = false; bool top = false; bool right = false; bool bottom = false; - + Vector2Int toCheck = position + new Vector2Int(0, -1); if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.ROCK) bottom = true; @@ -178,7 +178,7 @@ public class GenerationProcessor { if (right && bottom && !top && !left) { return ExtendedTileType.RockRD; - } + } if (left && top && bottom && !right) { return ExtendedTileType.RockLUD; @@ -201,4 +201,4 @@ public class GenerationProcessor { } return type; } -} \ No newline at end of file +}