v0.3.0d: enforced removing traps when setting terrain to a none-trap tile.

This commit is contained in:
Evan Debenham 2015-06-12 00:14:38 -04:00 committed by Evan Debenham
parent 88a55f3336
commit b7db57f665

View File

@ -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;