Skip to content

Commit

Permalink
Commit #54: Fixed bugs and did optimizations on A* code
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackJar72 committed Jul 15, 2015
1 parent c7ba0ea commit 2945c1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion java/jaredbgreat/dldungeons/Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public final class Info {
public static final String OLD_ID = "DLDungeonsJBG";
public static final String ID = "dldungeonsjdg";
public static final String NAME = "Doomlike Dungeons";
public static final String VERSION = "1.8.0";
public static final String VERSION = "1.8.1";
public static final String MINECRAFT = "1.7.10";
public static final String CHANNEL = "JBGDungeons";

Expand Down
14 changes: 13 additions & 1 deletion java/jaredbgreat/dldungeons/planner/astar/AStar.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,18 @@ public void seek() {
*/
public void makeRoute(Step end) {
Step child = end, parent = end.parent;
if(parent == null) return;
if(parent == null) return;

dungeon.map.astared[end.x][end.z] = true;
if(dungeon.map.isWall[end.x][end.z] ||
dungeon.map.isFence[end.x][end.z])
dungeon.map.isDoor[end.x][end.z] = true;
if(dungeon.map.hasLiquid[end.x][end.z]) {
dungeon.map.hasLiquid[end.x][end.z] = false;
dungeon.map.floorY[end.x][end.z] =
(byte) dungeon.rooms.get(room).floorY;
}

do {
dungeon.map.astared[child.x][child.z] = true;
if(dungeon.map.isWall[child.x][child.z] ||
Expand All @@ -110,6 +121,7 @@ public void makeRoute(Step end) {
child = parent;
parent = child.parent;
} while (parent != null);

dungeon.map.astared[child.x][child.z] = true;
if(dungeon.map.isWall[child.x][child.z] ||
dungeon.map.isFence[child.x][child.z])
Expand Down

0 comments on commit 2945c1f

Please sign in to comment.