ZPM generating patched. If it won't work this time, imma look for the

razors in the drawer...
This commit is contained in:
ericnerdo 2016-05-15 22:59:06 +02:00
parent 49072956a7
commit 2f8c4b7168
1 changed files with 11 additions and 6 deletions

View File

@ -228,7 +228,7 @@ public class Game {
} }
while (!source.canHazZPM()) { while (!source.canHazZPM()) {
int j = 0; int newSourceCounter = 0;
for (int i = 0; i < dungeon.getMapHeight(); i++) { for (int i = 0; i < dungeon.getMapHeight(); i++) {
compare = source.getAdjacentTile(Direction.getRandom()); compare = source.getAdjacentTile(Direction.getRandom());
@ -236,12 +236,17 @@ public class Game {
source = compare; source = compare;
} }
while(j != 20) { while(newSourceCounter != 20) {
compare = source.getAdjacentTile(Direction.getRandom()); compare = source.getAdjacentTile(Direction.getRandom());
if (compare != null) if (compare != null) {
if (!compare.hasZPM() && (compare.playerBaseOnTile == null)) source = compare;
source = compare; if (!compare.hasZPM() && (compare.playerBaseOnTile == null)) {
j++; if (source.canHazZPM()) {
break;
}
}
}
newSourceCounter++;
} }
} }