mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
self-connect tiles are working again
This commit is contained in:
@@ -443,14 +443,16 @@ internal object BlocksDrawer {
|
|||||||
|
|
||||||
private fun getNearbyTilesInfoConSelf(x: Int, y: Int, mode: Int, mark: Int): Int {
|
private fun getNearbyTilesInfoConSelf(x: Int, y: Int, mode: Int, mark: Int): Int {
|
||||||
val layer = when (mode) {
|
val layer = when (mode) {
|
||||||
TERRAIN -> world.layerTerrain
|
|
||||||
WALL -> world.layerWall
|
WALL -> world.layerWall
|
||||||
|
TERRAIN -> world.layerTerrain
|
||||||
ORES -> world.layerOres
|
ORES -> world.layerOres
|
||||||
FLUID -> world.layerFluids
|
FLUID -> world.layerFluids
|
||||||
else -> throw IllegalArgumentException()
|
else -> throw IllegalArgumentException("Unknown mode $mode")
|
||||||
|
}
|
||||||
|
val nearbyTiles = getNearbyTilesPos(x, y).map {
|
||||||
|
val (wx, wy) = world.coerceXY(it.x, it.y)
|
||||||
|
layer.unsafeGetTile(wx, wy)
|
||||||
}
|
}
|
||||||
|
|
||||||
val nearbyTiles = getNearbyTilesPos(x, y).map { layer.unsafeGetTile(x, y) }
|
|
||||||
|
|
||||||
var ret = 0
|
var ret = 0
|
||||||
for (i in nearbyTiles.indices) {
|
for (i in nearbyTiles.indices) {
|
||||||
|
|||||||
Reference in New Issue
Block a user