From 359437a7bd8f84c556911cab1e58b24eaf1a28db Mon Sep 17 00:00:00 2001 From: Triceraptodactyl Date: Wed, 25 Apr 2018 12:46:12 +0200 Subject: [PATCH] DungeonProcessor fixes --- Assets/Scripts/Generation/GenerationProcessor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Generation/GenerationProcessor.cs b/Assets/Scripts/Generation/GenerationProcessor.cs index 2127032..a8672fc 100644 --- a/Assets/Scripts/Generation/GenerationProcessor.cs +++ b/Assets/Scripts/Generation/GenerationProcessor.cs @@ -21,7 +21,7 @@ public class GenerationProcessor { int rotation = 0; switch ( tiles[v].type ) { case Room.TileType.WALL: - type = GetCorrectRockType(tiles, v); + type = GetCorrectWallType(tiles, v); rotation = GetCorrectWallRotation(tiles, v, type); break; case Room.TileType.GROUND: @@ -193,8 +193,9 @@ public class GenerationProcessor { } private int GetCorrectDoorRotation(ExtendedTileType type, Dictionary tiles, Vector2Int position) { + Vector2Int toCheck; if(type == ExtendedTileType.DoorOuter) { - Vector2Int toCheck = position + new Vector2Int(0, -1); + toCheck = position + new Vector2Int(0, -1); if (tiles.ContainsKey(toCheck) && tiles[toCheck].type == Room.TileType.DOOR) return 270; toCheck = position + new Vector2Int(-1, 0);