v0.6.1: fixed issues with ghost spawning position between floors
This commit is contained in:
parent
debd7d6436
commit
c8df657e51
|
@ -317,7 +317,7 @@ public class Dungeon {
|
||||||
PathFinder.setMapSize(level.width(), level.height());
|
PathFinder.setMapSize(level.width(), level.height());
|
||||||
|
|
||||||
Dungeon.level = level;
|
Dungeon.level = level;
|
||||||
DriedRose.restoreGhostHero( level, pos + PathFinder.NEIGHBOURS8[Random.Int(8)]);
|
DriedRose.restoreGhostHero( level, pos );
|
||||||
Actor.init();
|
Actor.init();
|
||||||
|
|
||||||
visible = new boolean[level.length()];
|
visible = new boolean[level.length()];
|
||||||
|
|
|
@ -256,6 +256,12 @@ public class DriedRose extends Artifact {
|
||||||
public static void restoreGhostHero( Level level, int pos ){
|
public static void restoreGhostHero( Level level, int pos ){
|
||||||
if (heldGhost != null){
|
if (heldGhost != null){
|
||||||
level.mobs.add( heldGhost );
|
level.mobs.add( heldGhost );
|
||||||
|
|
||||||
|
int ghostPos;
|
||||||
|
do {
|
||||||
|
ghostPos = pos + PathFinder.NEIGHBOURS8[Random.Int(8)];
|
||||||
|
} while (!Level.solid[ghostPos] || level.findMob(ghostPos) != null);
|
||||||
|
|
||||||
heldGhost.pos = pos;
|
heldGhost.pos = pos;
|
||||||
heldGhost = null;
|
heldGhost = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user