diff options
-rw-r--r-- | crawl-ref/source/beam.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/spells1.cc | 4 |
2 files changed, 11 insertions, 5 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 63552b960b..50cf568e9a 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -2819,9 +2819,15 @@ void fire_tracer(const monsters *monster, bolt &pbolt, bool explode_only) pbolt.is_tracer = false; } -bool check_line_of_sight( const coord_def& source, const coord_def& target ) +/** + * Checks whether target is in sight of source. + * + * Only used from cast_chain_lightning currently. + * XXX: Move to los.cc; integrate with other LOS code. + */ +bool check_line_of_sight(const coord_def& source, const coord_def& target) { - const int dist = grid_distance( source, target ); + const int dist = grid_distance(source, target); // Can always see one square away. if (dist <= 1) @@ -2834,7 +2840,7 @@ bool check_line_of_sight( const coord_def& source, const coord_def& target ) // Note that we are guaranteed to be within the player LOS range, // so fallback is unnecessary. ray_def ray; - return find_ray( source, target, false, ray ); + return find_ray(source, target, false, ray); } // When a mimic is hit by a ranged attack, it teleports away (the slow diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index 183855936b..8d503e2ca9 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -331,7 +331,7 @@ void cast_chain_lightning(int pow) if (invalid_monster(monster)) continue; - dist = grid_distance( source, monster->pos() ); + dist = grid_distance(source, monster->pos()); // check for the source of this arc if (!dist) @@ -344,7 +344,7 @@ void cast_chain_lightning(int pow) if (dist > min_dist) continue; - if (!check_line_of_sight( source, monster->pos() )) + if (!check_line_of_sight(source, monster->pos())) continue; count++; |