v0.2.4a: corrected errors with floors 26 and 27+

This commit is contained in:
Evan Debenham 2015-02-25 08:07:12 -05:00
parent 6c127894df
commit 4ec2e9deb7
2 changed files with 16 additions and 3 deletions

View File

@ -63,9 +63,9 @@ public class DeadEndLevel extends Level {
entrance = SIZE * WIDTH + SIZE / 2 + 1;
map[entrance] = Terrain.ENTRANCE;
exit = (SIZE / 2 + 1) * (WIDTH + 1);
map[(SIZE / 2 + 1) * (WIDTH + 1)] = Terrain.SIGN;
map[exit] = Terrain.SIGN;
exit = 0;
return true;
}
@ -91,7 +91,7 @@ public class DeadEndLevel extends Level {
@Override
public int randomRespawnCell() {
return -1;
return entrance-WIDTH;
}
}

View File

@ -23,6 +23,7 @@ import com.watabou.noosa.Scene;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
import com.watabou.utils.Bundle;
import com.watabou.utils.Random;
public class LastLevel extends Level {
@ -160,4 +161,16 @@ public class LastLevel extends Level {
super.addVisuals( scene );
HallsLevel.addVisuals( this, scene );
}
@Override
public void restoreFromBundle(Bundle bundle) {
super.restoreFromBundle(bundle);
for (int i=0; i < LENGTH; i++) {
int flags = Terrain.flags[map[i]];
if ((flags & Terrain.PIT) != 0){
passable[i] = avoid[i] = false;
solid[i] = true;
}
}
}
}