diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-17 14:34:42 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-17 14:34:42 +0000 |
commit | 9a976932d9978f756dcd631f3543ce152b4a41b7 (patch) | |
tree | 2a5c3db104c012e05362e10696420fae5b41dc8f /crawl-ref/source/spells1.cc | |
parent | 46291dca6b79000c560dffa183c8c73081f0763e (diff) | |
download | crawl-ref-9a976932d9978f756dcd631f3543ce152b4a41b7.tar.gz crawl-ref-9a976932d9978f756dcd631f3543ce152b4a41b7.zip |
Fix mephitic cloud allowing no self-targetting. (BR1995505)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5920 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells1.cc')
-rw-r--r-- | crawl-ref/source/spells1.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index a030b98b68..b90f3533cc 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -561,21 +561,25 @@ bool stinking_cloud( int pow, bolt &beem ) beem.is_beam = false; beem.aux_source.clear(); - // Fire tracer. - beem.source_x = you.x_pos; - beem.source_y = you.y_pos; - beem.can_see_invis = player_see_invis(); - beem.smart_monster = true; - beem.attitude = ATT_FRIENDLY; - beem.fr_count = 0; - beem.is_tracer = true; - fire_beam(beem); - - if (beem.fr_count > 0) + // Don't bother tracing if you're targetting yourself. + if (beem.target_x != you.x_pos || beem.target_y != you.y_pos) { - // We don't want to fire through friendlies. - canned_msg(MSG_OK); - return (false); + // Fire tracer. + beem.source_x = you.x_pos; + beem.source_y = you.y_pos; + beem.can_see_invis = player_see_invis(); + beem.smart_monster = true; + beem.attitude = ATT_FRIENDLY; + beem.fr_count = 0; + beem.is_tracer = true; + fire_beam(beem); + + if (beem.fr_count > 0) + { + // We don't want to fire through friendlies. + canned_msg(MSG_OK); + return (false); + } } // Really fire. |