From cb5601f0a4ec37e685dd0460de5eb46beedf7e34 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 28 Jan 2009 20:53:44 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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 messages; -- cgit v1.2.3-54-g00ecf