From 4b957f76a4e01a2385cce8fe1d140b46c28b3512 Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Mon, 30 Nov 2020 12:02:37 +0900 Subject: semi solution --- .../roomprocessor/RoomProcessorBoxSolver.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java index 7206352b..f8b53d3d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBoxSolver.java @@ -146,9 +146,12 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { if (calculate) { if (Minecraft.getMinecraft().thePlayer.getPosition().getY() < 68) { try { - solution = solve(currboard, playerPos.x, playerPos.y); - if (solution != null) - solution.addFirst(new Move(playerPos.x, playerPos.y)); + LinkedList semiSolution; + semiSolution = solve(currboard, playerPos.x, playerPos.y); + if (semiSolution != null) { + semiSolution.addFirst(new Move(playerPos.x, playerPos.y)); + solution = semiSolution; + } } catch (Error e) { e.printStackTrace(); } @@ -156,9 +159,11 @@ public class RoomProcessorBoxSolver extends GeneralRoomProcessor { for (int i = 0; i < 7; i++) { if (currboard[5][i] == 0) { try { - solution = solve(currboard, i, 5); - if (solution != null) { - solution.addFirst(new Move(i, 5)); + LinkedList semiSolution; + semiSolution = solve(currboard, i, 5); + if (semiSolution != null) { + semiSolution.addFirst(new Move(i, 5)); + solution = semiSolution; break; } } catch (Error e) { -- cgit