v0.6.0: re-added traps not being allowed in connection rooms on floor 1
This commit is contained in:
parent
045e398d8f
commit
2852d94c5d
|
@ -24,8 +24,10 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.painters;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Patch;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Patch;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.connection.ConnectionRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.StandardRoom;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.watabou.utils.PathFinder;
|
import com.watabou.utils.PathFinder;
|
||||||
|
@ -259,7 +261,15 @@ public class RegularPainter extends Painter {
|
||||||
|
|
||||||
for (int i = 0; i < l.length(); i ++) {
|
for (int i = 0; i < l.length(); i ++) {
|
||||||
if (l.map[i] == Terrain.EMPTY){
|
if (l.map[i] == Terrain.EMPTY){
|
||||||
validCells.add(i);
|
//TODO rooms should probably be able to handle trap placement
|
||||||
|
if (Dungeon.depth == 1){
|
||||||
|
Room r = ((RegularLevel)l).room(i);
|
||||||
|
if (r != null && !(r instanceof ConnectionRoom)){
|
||||||
|
validCells.add(i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
validCells.add(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user