From 5e94dac9e3537693dfaa1647c143959d1ce5e069 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 12 Dec 2006 13:49:05 +0000 Subject: Better explore-stop messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@619 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/delay.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/delay.cc') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 5f5879ac15..55ba0bb96c 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -909,12 +909,13 @@ inline static void monster_warning(activity_interrupt_type ai, } } -void interrupt_activity( activity_interrupt_type ai, +// Returns true if any activity was stopped. +bool interrupt_activity( activity_interrupt_type ai, const activity_interrupt_data &at ) { const int delay = current_delay_action(); if (delay == DELAY_NOT_DELAYED) - return; + return (false); // First try to stop the current delay. const delay_queue_item &item = you.delay_queue.front(); @@ -923,7 +924,7 @@ void interrupt_activity( activity_interrupt_type ai, { monster_warning(ai, at, item.type); stop_delay(); - return; + return (true); } // Check the other queued delays; the first delay that is interruptible @@ -943,16 +944,18 @@ void interrupt_activity( activity_interrupt_type ai, { monster_warning(ai, at, you.delay_queue[j].type); stop_delay(); - return; + return (true); } } // Non-run queued delays can be discarded without any processing. you.delay_queue.erase( you.delay_queue.begin() + i, you.delay_queue.end() ); - break; + return (true); } } + + return (false); } static const char *activity_interrupt_names[] = -- cgit v1.2.3-54-g00ecf