Skip to content

Commit 78bf163

Browse files
committed
Fix pathfinding
1 parent d27ca0a commit 78bf163

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/xyz/jadonfowler/phasebot/Bot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void fall() {
105105

106106
public void jump(double x, double y, double z) {
107107
if (y > 0) move(0, Math.abs(y), 0);
108-
if (x != 0 && z != 0) move(x, 0, z);
108+
move(x, 0, z);
109109
fall();
110110
centerPosition();
111111
}

src/xyz/jadonfowler/phasebot/pathfind/AStar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private int abs(int i) {
7676

7777
public ArrayList<Tile> iterate() {
7878
if (!checkOnce) {
79-
checkOnce = true;
79+
checkOnce ^= true;
8080
if ((abs(sx - ex) > range) || (abs(sy - ey) > range) || (abs(sz - ez) > range)) {
8181
this.result = PathingResult.NO_PATH;
8282
return null;// jump out

0 commit comments

Comments
 (0)