diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-02 09:21:55 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-02 09:21:55 +0000 |
commit | 145574d7faad160fb212d68a693454ea08d59b4f (patch) | |
tree | 67a2d4fd8b2f289d9210dd428aca84c6c405a84b /crawl-ref/source/beam.cc | |
parent | 99fcce0830ca9642fdc2dd8c35d9e1ac3b788116 (diff) | |
download | crawl-ref-145574d7faad160fb212d68a693454ea08d59b4f.tar.gz crawl-ref-145574d7faad160fb212d68a693454ea08d59b4f.zip |
Fix [2481621]: positive self-targeting enchantments prompted.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8112 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 451056e5d7..66185cc0c2 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1458,7 +1458,13 @@ void bolt::initialize_fire() } if (target == source) - range = 0; + { + range = 0; + aimed_at_feet = true; + auto_hit = true; + aimed_at_spot = true; + use_target_as_pos = true; + } if (range == -1) { @@ -1903,13 +1909,7 @@ void bolt::do_fire() #endif msg_generated = false; - if (target == source) - { - auto_hit = true; - aimed_at_spot = true; - use_target_as_pos = true; - } - else + if (!aimed_at_feet) { choose_ray(); // Take *one* step, so as not to hurt the source. @@ -3241,18 +3241,18 @@ bool bolt::harmless_to_player() const mprf(MSGCH_DIAGNOSTICS, "beam flavour: %d", flavour); #endif - // Shouldn't happen anyway since enchantments are either aimed at self - // (not prompted) or cast at monsters and don't explode or bounce. - if (is_enchantment()) - return (false); - - // The others are handled here. switch (flavour) { case BEAM_VISUAL: case BEAM_DIGGING: return (true); + // Positive enchantments. + case BEAM_HASTE: + case BEAM_HEALING: + case BEAM_INVISIBILITY: + return (true); + // Cleansing flame doesn't affect player's followers. case BEAM_HOLY: return (is_good_god(you.religion)); |