From b8e11ca62974439ca6ff7930f7cf722053c10479 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 2 Dec 2007 11:35:00 +0000 Subject: Trunk->0.3 merge (2946): Stop travel when monster beam attack misses player. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2968 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 6 ++++++ crawl-ref/source/delay.cc | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index ef1ac0a1df..0ab2ff59e2 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -36,6 +36,7 @@ #include "cio.h" #include "cloud.h" +#include "delay.h" #include "effects.h" #include "enum.h" #include "it_use2.h" @@ -3052,6 +3053,11 @@ static int affect_player( bolt &beam ) return (range_used_on_hit(beam)); } + // Trigger an interrupt, so travel will stop on misses + // which generate smoke. + if (!YOU_KILL(beam.thrower)) + interrupt_activity(AI_MONSTER_ATTACKS); + // BEGIN real beam code beam.msg_generated = true; diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index c72a15f30b..4c1e1988a0 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -917,7 +917,7 @@ void run_macro(const char *macroname) #endif } -// Returns true if the delay should be interrupted, false if the user function +// Returns 1 if the delay should be interrupted, 0 if the user function // had no opinion on the matter, -1 if the delay should not be interrupted. static int userdef_interrupt_activity( const delay_queue_item &idelay, activity_interrupt_type ai, -- cgit v1.2.3-54-g00ecf