diff options
author | Neil Moore <neil@s-z.org> | 2014-06-06 12:12:18 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2014-06-06 12:12:18 -0400 |
commit | acf1c2352c425cd0a0069116e28d240042ce1cbb (patch) | |
tree | 1e9203474fdf86824beb7c187929ab341810173b /crawl-ref/source/spl-util.cc | |
parent | 9c8486b75d30b98dcc595b0c1fca06ba99dcf6d5 (diff) | |
download | crawl-ref-acf1c2352c425cd0a0069116e28d240042ce1cbb.tar.gz crawl-ref-acf1c2352c425cd0a0069116e28d240042ce1cbb.zip |
Count friendlies for targets-in-range check of neutral spells.
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r-- | crawl-ref/source/spl-util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc index 9c1db5d759..079b30963c 100644 --- a/crawl-ref/source/spl-util.cc +++ b/crawl-ref/source/spl-util.cc @@ -1285,6 +1285,8 @@ bool spell_no_hostile_in_range(spell_type spell, bool rod) // The healing spells. if (testbits(get_spell_flags(spell), SPFLAG_HELPFUL)) return false; + + const bool neutral = testbits(get_spell_flags(spell), SPFLAG_NEUTRAL); bolt beam; beam.flavour = BEAM_VISUAL; @@ -1335,7 +1337,8 @@ bool spell_no_hostile_in_range(spell_type spell, bool rod) tempbeam = beam; tempbeam.target = *ri; tempbeam.fire(); - if (tempbeam.foe_info.count > 0) + if (tempbeam.foe_info.count > 0 + || neutral && tempbeam.friend_info.count > 0) { found = true; break; |