summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-28 20:53:44 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-28 20:53:44 +0000
commitcb5601f0a4ec37e685dd0460de5eb46beedf7e34 (patch)
treef8254ab948b7fec892f328d1989c7722431fb67f /crawl-ref/source/beam.cc
parentdffee8499755c8d949733677cf73e3f227ee12cd (diff)
downloadcrawl-ref-cb5601f0a4ec37e685dd0460de5eb46beedf7e34.tar.gz
crawl-ref-cb5601f0a4ec37e685dd0460de5eb46beedf7e34.zip
Fix [2542259]: explosions do affect monsters in the sense that they
cause the beam to terminate. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8841 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc25
1 files changed, 20 insertions, 5 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 5d91ed8880..43dea290e7 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3751,7 +3751,11 @@ void bolt::affect_player()
// Explosions only have an effect during their explosion phase.
// Special cases can be handled here.
if (is_explosion && !in_explosion_phase)
+ {
+ // Trigger the explosion.
+ finish_beam();
return;
+ }
// Digging -- don't care.
if (flavour == BEAM_DIGGING)
@@ -4117,6 +4121,13 @@ void bolt::tracer_affect_monster(monsters* mon)
return;
}
+ // Trigger explosion on exploding beams.
+ if (is_explosion && !in_explosion_phase)
+ {
+ finish_beam();
+ return;
+ }
+
// Ignore self-detonating monsters.
if (mons_self_destructs(mon))
{
@@ -4336,11 +4347,6 @@ bool bolt::handle_statue_disintegration(monsters* mon)
void bolt::affect_monster(monsters* mon)
{
- // Explosions only have an effect during their explosion phase.
- // Special cases can be handled here.
- if (is_explosion && !in_explosion_phase)
- return;
-
// Don't hit dead monsters.
if (!mon->alive())
{
@@ -4395,6 +4401,15 @@ void bolt::affect_monster(monsters* mon)
if (mon->submerged() && !aimed_at_spot)
return; // passes overhead
+ if (is_explosion && !in_explosion_phase)
+ {
+ // It hit a monster, so the beam should terminate.
+ // Don't actually affect the monster; the explosion
+ // will take care of that.
+ finish_beam();
+ return;
+ }
+
// We need to know how much the monster _would_ be hurt by this,
// before we decide if it actually hits.
std::vector<std::string> messages;