diff options
author | gammafunk <gammafunk@gmail.com> | 2014-03-19 19:55:13 -0500 |
---|---|---|
committer | gammafunk <gammafunk@gmail.com> | 2014-03-19 20:03:25 -0500 |
commit | ea929c457ef6f9f3f728409443ba7f491507dbf9 (patch) | |
tree | 40c9015661549760f21436b5bf4d8e0534480203 /crawl-ref/source/mon-behv.cc | |
parent | d1e05d0324a772439015a592ef6e1551a8f93fcc (diff) | |
download | crawl-ref-ea929c457ef6f9f3f728409443ba7f491507dbf9.tar.gz crawl-ref-ea929c457ef6f9f3f728409443ba7f491507dbf9.zip |
Make a spell range check for spellforged servitor use r^2 distance
This was previously comparing a grid distance to a spell range for
purposes of setting the firing position.
Diffstat (limited to 'crawl-ref/source/mon-behv.cc')
-rw-r--r-- | crawl-ref/source/mon-behv.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc index 415da582f6..79e76d1518 100644 --- a/crawl-ref/source/mon-behv.cc +++ b/crawl-ref/source/mon-behv.cc @@ -875,13 +875,12 @@ void handle_behaviour(monster* mon) } // Hold position if we've reached our ideal range else if (mon->type == MONS_SPELLFORGED_SERVITOR - && mon->pos().distance_from(target->pos()) - <= mon->props["ideal_range"].get_int() + && (mon->pos() - target->pos()).abs() + <= dist_range(mon->props["ideal_range"].get_int()) && !one_chance_in(8)) { mon->firing_pos = mon->pos(); } - } break; |