summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-tornado.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-11-13 05:06:50 +0100
committerAdam Borowski <kilobyte@angband.pl>2011-11-13 13:09:27 +0100
commitd4ec7f300b6086c5a3a6b80eb006e7a11098db53 (patch)
tree9db1058e7df6dc45986e7f61a2c642d0e0fef260 /crawl-ref/source/spl-tornado.cc
parentd3257a5d2d64c1e7316d4c89696c4c3c0679b9bb (diff)
downloadcrawl-ref-d4ec7f300b6086c5a3a6b80eb006e7a11098db53.tar.gz
crawl-ref-d4ec7f300b6086c5a3a6b80eb006e7a11098db53.zip
Replace a bunch of floating-point sqrt()s by integer ones.
Diffstat (limited to 'crawl-ref/source/spl-tornado.cc')
-rw-r--r--crawl-ref/source/spl-tornado.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/crawl-ref/source/spl-tornado.cc b/crawl-ref/source/spl-tornado.cc
index 5b5a50ce0d..3771f110f2 100644
--- a/crawl-ref/source/spl-tornado.cc
+++ b/crawl-ref/source/spl-tornado.cc
@@ -400,10 +400,7 @@ void tornado_damage(actor *caster, int dur)
for (unsigned int i = 0; i < move_act.size(); i++)
{
coord_def pos = move_dest[move_act[i]->mid];
- int r;
- for (r = 0; r <= TORNADO_RADIUS; r++)
- if ((pos - org).abs() < sqr(r + 1) + 1)
- break;
+ int r = pos.range(org);
coord_def dest = _rotate(org, pos, move_avail, rdurs[r]);
for (unsigned int j = 0; j < move_avail.size(); j++)
if (move_avail[j] == dest)