diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 03:28:21 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 03:28:21 +0000 |
commit | a1daed8d5910d6fa5864eb702489a19c1f826278 (patch) | |
tree | 602d3ba21dc7c8ac53d8a151ec6cbdec78b2f254 /crawl-ref/source/beam.cc | |
parent | b681a24f5efdafaa86898a20d6df2ad936ce5a4e (diff) | |
download | crawl-ref-a1daed8d5910d6fa5864eb702489a19c1f826278.tar.gz crawl-ref-a1daed8d5910d6fa5864eb702489a19c1f826278.zip |
Self targeted visible beams are seen, even though they don't leave a visible
path.
Self targeted beams have a "path" consisting soley of the source square.
path_taken() is reset at the start of polt::fire()
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8228 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 1de2d83fea..22182655b1 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -267,7 +267,6 @@ bool player_tracer( zap_type ztype, int power, bolt &pbolt, int range) pbolt.seen = false; pbolt.reflections = 0; pbolt.bounces = 0; - pbolt.path_taken.clear(); pbolt.fire(); @@ -1539,6 +1538,15 @@ void bolt::initialize_fire() } } + // Visible self-targeted beams are always seen, even though they don't + // leave a path. + if (see_grid(source) && target == source && !invisible()) + seen = true; + + // Self-targeted beams have a "path" consisting the source position. + if (target == source) + path_taken.push_back(source); + #if DEBUG_DIAGNOSTICS mprf( MSGCH_DIAGNOSTICS, "%s%s%s [%s] (%d,%d) to (%d,%d): " "ty=%d col=%d flav=%d hit=%d dam=%dd%d range=%d", @@ -1875,6 +1883,8 @@ void bolt::affect_cell() // This saves some important things before calling fire(). void bolt::fire() { + path_taken.clear(); + if (is_tracer) { bolt boltcopy = *this; @@ -2664,7 +2674,6 @@ void fire_tracer(const monsters *monster, bolt &pbolt, bool explode_only) // Clear misc pbolt.reflections = 0; pbolt.bounces = 0; - pbolt.path_taken.clear(); // If there's a specifically requested foe_ratio, honour it. if (!pbolt.foe_ratio) |