Skip to content

Commit 9a05a2b

Browse files
revert: "refactor: Reuse already computed values on CataclysmicMap"
partially reverts commit cefee34
1 parent 60a07ea commit 9a05a2b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/cataclysmicmap/handlers/DungeonMapColorParser.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ object DungeonMapColorParser {
8181
val index = arrayY * 11 + arrayX
8282
val cached = cachedTiles.getOrElse(index) { return Unknown(0, 0) }
8383
if (cached == null) {
84-
val xPos = DungeonScanner.startX + arrayX * halfRoom
85-
val zPos = DungeonScanner.startZ + arrayY * halfRoom
84+
val xPos = DungeonScanner.startX + arrayX * (DungeonScanner.roomSize shr 1)
85+
val zPos = DungeonScanner.startZ + arrayY * (DungeonScanner.roomSize shr 1)
8686
cachedTiles[index] = scanTile(arrayX, arrayY, xPos, zPos)
8787
}
8888
return cachedTiles[index] ?: Unknown(0, 0)

src/main/kotlin/gg/skytils/skytilsmod/features/impl/dungeons/cataclysmicmap/handlers/DungeonScanner.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ object DungeonScanner {
5858
for (x in 0..10) {
5959
for (z in 0..10) {
6060
// Translates the grid index into world position.
61-
val xPos = startX + x * DungeonMapColorParser.halfRoom
62-
val zPos = startZ + z * DungeonMapColorParser.halfRoom
61+
val xPos = startX + x * (roomSize shr 1)
62+
val zPos = startZ + z * (roomSize shr 1)
6363

6464
if (!mc.theWorld.getChunkFromChunkCoords(xPos shr 4, zPos shr 4).isLoaded) {
6565
// The room being scanned has not been loaded in.

0 commit comments

Comments
 (0)