1
0
Fork 0

Rock Wall Fix

This commit is contained in:
Triceraptodactyl 2018-04-23 01:21:35 +02:00
parent 1199d14774
commit 60c6ff317b

View file

@ -106,7 +106,7 @@ public class GenerationProcessor {
}
private ExtendedTileType getCorrectWallType(Dictionary<Vector2Int, GenTile> 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<Vector2Int, GenTile> 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;
}
}
}