aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java10
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
index 2a2e402c..7dc25774 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
@@ -259,7 +259,7 @@ public class MapProcessor {
}
if (lastMapData == null && mapData != null) buildMap(mapData);
- processMap(mapData);
+ else if (mapData != null) processMap(mapData);
lastMapData = mapData;
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
index b31193c7..c64d15f1 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
@@ -49,14 +49,18 @@ public class RoomMatcher {
for (int i = 0; i < rotation; i++)
res = ArrayUtils.rotateCounterClockwise(res);
+ System.out.println("Trying to match "+dungeonRoomInfo.getUuid().toString()+" / "+dungeonRoomInfo.getName()+"... at rotation "+rotation);
+
int y = dungeonRoom.getMin().getY();
for (int z = 0; z < res.length; z ++) {
for (int x = 0; x < res[0].length; x++) {
- int data = res[y][x];
+ int data = res[z][x];
if (data == -1) continue;
Block b = dungeonRoom.getRelativeBlockAt(x,y,z);
- if (b == null) return false;
- if (Block.getIdFromBlock(b) != data) return false;
+ if (b == null || Block.getIdFromBlock(b) != data) {
+ System.out.println("Match failed at offset X"+x+" / Z"+z+". expected "+data+" but found "+b +" ("+Block.getIdFromBlock(b)+")");
+ return false;
+ }
}
}
return true;