diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-08-19 21:51:22 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-08-19 21:51:22 +0000 |
commit | b7fc7189b832bdbd745f3ca615c69376394661cc (patch) | |
tree | d212b72bf00f3cf35b0eb88abcf4dfe9c12216f6 /crawl-ref/source/terrain.cc | |
parent | dc1341888ccd8cfb3d6cd2518103670a12601745 (diff) | |
download | crawl-ref-b7fc7189b832bdbd745f3ca615c69376394661cc.tar.gz crawl-ref-b7fc7189b832bdbd745f3ca615c69376394661cc.zip |
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
Diffstat (limited to 'crawl-ref/source/terrain.cc')
-rw-r--r-- | crawl-ref/source/terrain.cc | 4 |
1 files changed, 3 insertions, 1 deletions
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); |