summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-17 14:34:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-17 14:34:42 +0000
commit9a976932d9978f756dcd631f3543ce152b4a41b7 (patch)
tree2a5c3db104c012e05362e10696420fae5b41dc8f
parent46291dca6b79000c560dffa183c8c73081f0763e (diff)
downloadcrawl-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
-rw-r--r--crawl-ref/source/beam.cc2
-rw-r--r--crawl-ref/source/directn.cc1
-rw-r--r--crawl-ref/source/spells1.cc32
-rw-r--r--crawl-ref/source/spl-util.cc1
4 files changed, 21 insertions, 15 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index d63d6d8cfd..bc8f19d7f9 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3617,7 +3617,7 @@ static int _affect_player( bolt &beam, item_def *item )
if (beam.is_tracer)
{
// Check whether thrower can see player, unless thrower == player.
- if (beam.thrower != KILL_YOU_MISSILE
+ if (beam.thrower != KILL_YOU_MISSILE && beam.thrower != KILL_YOU
&& (beam.can_see_invis || !you.invisible()
|| _fuzz_invis_tracer(beam)))
{
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 6e395a802a..f9800d3a21 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -960,6 +960,7 @@ void direction(dist& moves, targeting_type restricts,
&& mode == TARG_ENEMY
&& !yesno("Really target yourself?", false, 'n'))
{
+ mpr("not self-targetting");
mesclr();
show_prompt = true;
}
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.
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index f308ca2f55..416a13b28f 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -770,6 +770,7 @@ bool spell_direction( dist &spelld, bolt &pbolt,
if (!spelld.isValid)
{
// Check for user cancel.
+ mpr("user canceled");
canned_msg(MSG_OK);
return (false);
}