summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorChris Campbell <chriscampbell89@gmail.com>2014-05-22 22:33:20 +0100
committerChris Campbell <chriscampbell89@gmail.com>2014-05-22 22:35:09 +0100
commita23ad50d6a454741291816d1a0c703c5458af4f8 (patch)
tree7d6d83913c5a24729b7e6fe8a0d688f2a3ad59f3 /crawl-ref/source/misc.cc
parenta89e4152e97dc4db7a5e7d7920fb72ca02aa8c8d (diff)
downloadcrawl-ref-a23ad50d6a454741291816d1a0c703c5458af4f8.tar.gz
crawl-ref-a23ad50d6a454741291816d1a0c703c5458af4f8.zip
Simplify
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 7d298084f7..fb26644805 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1183,11 +1183,7 @@ void search_around()
if (you_worship(GOD_ASHENZARI) && !player_under_penance())
skill += you.piety * 2;
- int farskill = skill;
-
- // Traps and doors stepdown skill:
- // skill/(2x-1) for squares at distance x
- int max_dist = div_rand_round(farskill, 32);
+ int max_dist = div_rand_round(skill, 32);
if (max_dist > 5)
max_dist = 5;
if (max_dist < 1)
@@ -1203,7 +1199,7 @@ void search_around()
// Own square is not excluded; may be flying.
// XXX: Currently, flying over a trap will always detect it.
- int effective = (dist <= 1) ? skill : farskill / (dist * 2 - 1);
+ int effective = (dist <= 1) ? skill : skill / (dist * 2 - 1);
trap_def* ptrap = find_trap(*ri);
if (!ptrap)