Fix jigsaw connectors having wrong understanding of "opposite"

This commit is contained in:
DBotThePony 2024-04-18 18:35:27 +07:00
parent 3b642ffe40
commit fde196ceae
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 3 additions and 3 deletions

View File

@ -14,11 +14,11 @@ enum class DungeonDirection(override val jsonName: String, val positionAdjustmen
}, },
UP("up", Vector2i.POSITIVE_Y) { UP("up", Vector2i.POSITIVE_Y) {
override val opposite: DungeonDirection override val opposite: DungeonDirection
get() = UP get() = DOWN
}, },
DOWN("down", Vector2i.NEGATIVE_Y) { DOWN("down", Vector2i.NEGATIVE_Y) {
override val opposite: DungeonDirection override val opposite: DungeonDirection
get() = DOWN get() = UP
}, },
UNKNOWN("unknown", Vector2i.ZERO) { UNKNOWN("unknown", Vector2i.ZERO) {
override val opposite: DungeonDirection override val opposite: DungeonDirection

View File

@ -315,7 +315,7 @@ class DungeonPart(data: JsonData) {
} }
fun tileUsesPlaces(x: Int, y: Int): Boolean { fun tileUsesPlaces(x: Int, y: Int): Boolean {
return reader.walkTilesAt(x, y) { x, y, tile -> if (tile.usesPlaces) KOptional(true) else KOptional() }.orElse(false) return reader.walkTilesAt(x, y) { _, _, tile -> if (tile.usesPlaces) KOptional(true) else KOptional() }.orElse(false)
} }
fun collidesWithPlaces(x: Int, y: Int, world: DungeonWorld): Boolean { fun collidesWithPlaces(x: Int, y: Int, world: DungeonWorld): Boolean {