From d03bcac5636625a61db20500a51418227316b34b Mon Sep 17 00:00:00 2001 From: zelgadis Date: Tue, 25 Nov 2008 14:38:49 +0000 Subject: Merge r7607: prevent crash if command repetition is interupted by multiple "`"s. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@7609 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 5c496fafce..cad9eecef1 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -1397,7 +1397,9 @@ static void _input() { // User pressed a key, so stop repeating commands and discard // the keypress. - crawl_state.cancel_cmd_repeat(); + crawl_state.cancel_cmd_repeat("Key pressed, interrupting command " + "repetition."); + crawl_state.prev_cmd = CMD_NO_CMD; getchm(); return; } @@ -4391,7 +4393,8 @@ static void _setup_cmd_repeat() { repeat_again_rec.keys.pop_front(); } - while (repeat_again_rec.keys[0] != ch); + while (repeat_again_rec.keys.size() > 0 + && repeat_again_rec.keys[0] != ch); repeat_again_rec.keys.pop_front(); } -- cgit v1.2.3