summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-07-17 03:57:58 -0400
committerNeil Moore <neil@s-z.org>2014-07-17 04:04:17 -0400
commitbaffb6df9d99e52ad0fe5f34ac6835533ac253aa (patch)
tree6097b29950b82d5747fc7a674cd049b6debe9745 /crawl-ref/source/beam.cc
parent05c403e465d1724c8c76f2475e05ba12c8644c24 (diff)
downloadcrawl-ref-baffb6df9d99e52ad0fe5f34ac6835533ac253aa.tar.gz
crawl-ref-baffb6df9d99e52ad0fe5f34ac6835533ac253aa.zip
Make blocked beams fall back to visible paths if possible (#8804).
In this position, you would be able to see the kobold, but trying to shoot it would say your line of fire is blocked by the wall: ..#@ K.8. If the statue weren't there the beam would avoid the wall perfectly well. Furthermore, the "Aim" prompt does in fact say "fire blocked by a granite statue", not "wall"; only the tracer and beam reported the opaque wall as the reason for losing LOF. When no LOS_SOLID_SEE ray is found for a beam, now we first try falling back to a LOS_DEFAULT ray; only if that too fails do we take the straight-path fallback.
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 7c8f74ca76..7f4e84f8f7 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -681,10 +681,13 @@ void bolt::apply_beam_conducts()
void bolt::choose_ray()
{
- if (!chose_ray || reflections > 0)
+ if ((!chose_ray || reflections > 0)
+ && !find_ray(source, target, ray, opc_solid_see)
+ // If fire is blocked, at least try a visible path so the
+ // error message is better.
+ && !find_ray(source, target, ray, opc_default))
{
- if (!find_ray(source, target, ray, opc_solid_see))
- fallback_ray(source, target, ray);
+ fallback_ray(source, target, ray);
}
}