From 2852d94c5d98826e44ef3f01e9e1a8e948eac8f7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 1 May 2017 15:11:32 -0400 Subject: [PATCH] v0.6.0: re-added traps not being allowed in connection rooms on floor 1 --- .../levels/painters/RegularPainter.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java index 175be1392..b9204df0c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/painters/RegularPainter.java @@ -24,8 +24,10 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.painters; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Patch; +import com.shatteredpixel.shatteredpixeldungeon.levels.RegularLevel; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; 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.traps.Trap; import com.watabou.utils.PathFinder; @@ -259,7 +261,15 @@ public class RegularPainter extends Painter { for (int i = 0; i < l.length(); i ++) { 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); + } } }