diff options
Diffstat (limited to 'crawl-ref/source/spells2.cc')
-rw-r--r-- | crawl-ref/source/spells2.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index a31c75483e..f181ab51b5 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -57,16 +57,17 @@ int detect_traps( int pow ) for (int i = 0; i < MAX_TRAPS; i++) { - const coord_def p = env.trap[i].pos; + trap_def& trap = env.trap[i]; - if (grid_distance( you.pos(), p) < range - && grd(p) == DNGN_UNDISCOVERED_TRAP) + if (!trap.active()) + continue; + + if (grid_distance(you.pos(), trap.pos) < range && !trap.is_known()) { traps_found++; - - grd(p) = trap_category( env.trap[i].type ); - set_envmap_obj(p, grd(p)); - set_terrain_mapped(p); + trap.reveal(); + set_envmap_obj(trap.pos, grd(trap.pos)); + set_terrain_mapped(trap.pos); } } |