From b7db57f665bef10e95646f862784fbf7080ee0c5 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 12 Jun 2015 00:14:38 -0400 Subject: [PATCH] v0.3.0d: enforced removing traps when setting terrain to a none-trap tile. --- .../shatteredpixel/shatteredpixeldungeon/levels/Level.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java index 8e9515784..69a787cf4 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/Level.java @@ -635,6 +635,10 @@ public abstract class Level implements Bundlable { public static void set( int cell, int terrain ) { Painter.set( Dungeon.level, cell, terrain ); + if (terrain != Terrain.TRAP && terrain != Terrain.SECRET_TRAP){ + Dungeon.level.traps.remove( cell ); + } + int flags = Terrain.flags[terrain]; passable[cell] = (flags & Terrain.PASSABLE) != 0; losBlocking[cell] = (flags & Terrain.LOS_BLOCKING) != 0;