From b7fc7189b832bdbd745f3ca615c69376394661cc Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 19 Aug 2009 21:51:22 +0000 Subject: Make dungeon_terrain_changed() not destroy traps when the feature is changing *into* a trap, so that Trowel cards and the "&L" wiz command can place traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10580 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/terrain.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/terrain.cc') diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc index 4c470000eb..aa4eba2335 100644 --- a/crawl-ref/source/terrain.cc +++ b/crawl-ref/source/terrain.cc @@ -610,7 +610,9 @@ void dungeon_terrain_changed(const coord_def &pos, if (is_notable_terrain(nfeat) && see_grid(pos)) seen_notable_thing(nfeat, pos); - destroy_trap(pos); + // Don't destroy a trap which was just placed. + if (nfeat < DNGN_TRAP_MECHANICAL || nfeat > DNGN_UNDISCOVERED_TRAP) + destroy_trap(pos); } _dgn_check_terrain_items(pos, preserve_items); -- cgit v1.2.3-54-g00ecf