v0.6.0: fixed crashes relating to random cell logic on floor 25
This commit is contained in:
parent
6bac24ac89
commit
73aed6726c
|
@ -167,10 +167,10 @@ public class HallsBossLevel extends Level {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int randomRespawnCell() {
|
public int randomRespawnCell() {
|
||||||
if (entrance == -1) return entrance;
|
int pos = entrance == -1 ? stairs : entrance;
|
||||||
int cell = entrance + PathFinder.NEIGHBOURS8[Random.Int(8)];
|
int cell = pos + PathFinder.NEIGHBOURS8[Random.Int(8)];
|
||||||
while (!passable[cell]){
|
while (!passable[cell]){
|
||||||
cell = entrance + PathFinder.NEIGHBOURS8[Random.Int(8)];
|
cell = pos + PathFinder.NEIGHBOURS8[Random.Int(8)];
|
||||||
}
|
}
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user