mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 03:53:12 -04:00
Fixed "Top" edge tiles not showing - kudos @legacymtgsalvationuser69544
This commit is contained in:
parent
1a7e396339
commit
ef53f35e0f
@ -92,13 +92,13 @@ class TileLayerTerrain(tileGroup: TileGroup, size: Float) : TileLayer(tileGroup,
|
||||
if (!tile.isTilemapInitialized()) // fake tile
|
||||
return emptySequence()
|
||||
return tile.neighbors
|
||||
.filter { it.position.x < tile.position.x || it.position.y < tile.position.y }
|
||||
.flatMap { getMatchingEdges(tile, it) }
|
||||
}
|
||||
|
||||
private fun getMatchingEdges(originTile: Tile, neighborTile: Tile): List<String>{
|
||||
val vectorToNeighbor = neighborTile.position.cpy().sub(originTile.position)
|
||||
val direction = NeighborDirection.fromVector(vectorToNeighbor) ?: return emptyList()
|
||||
val direction = NeighborDirection.fromVector(vectorToNeighbor)
|
||||
?: return emptyList()
|
||||
val possibleEdgeFiles = strings().edgeImagesByPosition[direction] ?: return emptyList()
|
||||
|
||||
return possibleEdgeFiles.filter {
|
||||
|
Loading…
x
Reference in New Issue
Block a user