v0.4.2: fixed issues with wands of fireblast and regrowth

This commit is contained in:
Evan Debenham
2016-09-04 04:21:31 -04:00
parent e9b5161d5e
commit 0c4d302979
3 changed files with 26 additions and 17 deletions

View File

@@ -41,6 +41,10 @@ public class PathFinder {
public static int[] NEIGHBOURS4;
public static int[] NEIGHBOURS8;
public static int[] NEIGHBOURS9;
//similar to NEIGHBOURS8, but the order is circular.
//Useful for some logic functions, but is slower due to lack of array-access order.
public static int[] CIRCLE;
public static void setMapSize( int width, int height ) {
@@ -59,6 +63,8 @@ public class PathFinder {
NEIGHBOURS4 = new int[]{-width, -1, +1, +width};
NEIGHBOURS8 = new int[]{-width-1, -width, -width+1, -1, +1, +width-1, +width, +width+1};
NEIGHBOURS9 = new int[]{-width-1, -width, -width+1, -1, 0, +1, +width-1, +width, +width+1};
CIRCLE = new int[]{-width-1, -width, -width+1, +1, +width+1, +width, +width-1, -1};
}
//TODO currently this isn't used, and all pathfinding is recomputed each step.