Skip to content

Commit 221debd

Browse files
feat: add backreference from Room tile to UniqueRoom holder
1 parent c5f1556 commit 221debd

File tree

1 file changed

+6
-1
lines changed
  • src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/map

1 file changed

+6
-1
lines changed

src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/catlas/core/map/Room.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Room(override val x: Int, override val z: Int, var data: RoomData) : Tile
4242
else -> CatlasConfig.colorRoom
4343
}
4444
}
45+
var uniqueRoom: UniqueRoom? = null
4546

4647
fun getArrayPosition(): Pair<Int, Int> {
4748
return Pair((x - DungeonScanner.startX) / 16, (z - DungeonScanner.startZ) / 16)
@@ -51,9 +52,13 @@ class Room(override val x: Int, override val z: Int, var data: RoomData) : Tile
5152
val unique = DungeonInfo.uniqueRooms.find { it.name == roomName }
5253

5354
if (unique == null) {
54-
DungeonInfo.uniqueRooms.add(UniqueRoom(column, row, this))
55+
UniqueRoom(column, row, this).let {
56+
DungeonInfo.uniqueRooms.add(it)
57+
uniqueRoom = it
58+
}
5559
} else {
5660
unique.addTile(column, row, this)
61+
uniqueRoom = unique
5762
}
5863
}
5964
}

0 commit comments

Comments
 (0)