From fde196ceaefba34b601fb4a4c72391152b5b1fc5 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 18 Apr 2024 18:35:27 +0700 Subject: [PATCH] Fix jigsaw connectors having wrong understanding of "opposite" --- .../dbotthepony/kstarbound/defs/dungeon/DungeonDirection.kt | 4 ++-- .../ru/dbotthepony/kstarbound/defs/dungeon/DungeonPart.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonDirection.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonDirection.kt index 5d768567..ef8c93a3 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonDirection.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonDirection.kt @@ -14,11 +14,11 @@ enum class DungeonDirection(override val jsonName: String, val positionAdjustmen }, UP("up", Vector2i.POSITIVE_Y) { override val opposite: DungeonDirection - get() = UP + get() = DOWN }, DOWN("down", Vector2i.NEGATIVE_Y) { override val opposite: DungeonDirection - get() = DOWN + get() = UP }, UNKNOWN("unknown", Vector2i.ZERO) { override val opposite: DungeonDirection diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonPart.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonPart.kt index b0f3fe68..9437b270 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonPart.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/defs/dungeon/DungeonPart.kt @@ -315,7 +315,7 @@ class DungeonPart(data: JsonData) { } 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 {