summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/delay.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 01:19:56 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 01:19:56 +0000
commit725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd (patch)
treed2644ce5f13e7ab649b27b49f7bdcde18802a6b1 /crawl-ref/source/delay.cc
parent1a36197574afe860feff7208cd883770a5d28946 (diff)
downloadcrawl-ref-725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd.tar.gz
crawl-ref-725cb5b4d5a3ade5c5e7b04a6210cedc839c2bdd.zip
Added new commands "re-do previous command" (bound to `) and "repeat
next command" (bound to 0). Though this is just an interface change, it changes code in the core input processing function (input() in acr.cc), and also messes around with the input buffer, so it could probably do with more testing before merging it into the 0.3 branch. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2137 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r--crawl-ref/source/delay.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index 9097e371c2..b2b443c0d1 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -37,6 +37,7 @@
#include "randart.h"
#include "religion.h"
#include "spl-util.h"
+#include "state.h"
#include "stuff.h"
#include "travel.h"
#include "tutorial.h"
@@ -102,6 +103,8 @@ static void clear_pending_delays()
void start_delay( delay_type type, int turns, int parm1, int parm2 )
/***********************************************************/
{
+ ASSERT(!crawl_state.is_repeating_cmd() || type == DELAY_MACRO);
+
delay_queue_item delay;
delay.type = type;
@@ -146,6 +149,8 @@ void stop_delay( void )
delay_queue_item delay = you.delay_queue.front();
+ ASSERT(!crawl_state.is_repeating_cmd() || delay.type == DELAY_MACRO);
+
const bool butcher_swap_warn =
delay.type == DELAY_BUTCHER
&& (you.delay_queue.size() >= 2
@@ -304,6 +309,8 @@ void handle_delay( void )
delay_queue_item &delay = you.delay_queue.front();
+ ASSERT(!crawl_state.is_repeating_cmd() || delay.type == DELAY_MACRO);
+
// Run delays and Lua delays don't have a specific end time.
if (is_run_delay(delay.type))
{
@@ -992,7 +999,7 @@ inline static void monster_warning(activity_interrupt_type ai,
if (!mon->visible())
return;
#ifndef DEBUG_DIAGNOSTICS
- if (at.context != "uncharm")
+ if (at.context == "newly seen")
{
// Only say "comes into view" if the monster wasn't in view
// during the previous turn.
@@ -1084,7 +1091,10 @@ bool interrupt_activity( activity_interrupt_type ai,
const activity_interrupt_data &at )
{
paranoid_option_disable(ai, at);
-
+
+ if (crawl_state.is_repeating_cmd())
+ return interrupt_cmd_repeat(ai, at);
+
const int delay = current_delay_action();
if (delay == DELAY_NOT_DELAYED)