diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 14:38:49 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-25 14:38:49 +0000 |
commit | d03bcac5636625a61db20500a51418227316b34b (patch) | |
tree | 9cf9a81ae9bd6950739e370ceb155874fdb250c8 /crawl-ref | |
parent | 0383d17808a555f6de2129d16be6f774fa349ad6 (diff) | |
download | crawl-ref-d03bcac5636625a61db20500a51418227316b34b.tar.gz crawl-ref-d03bcac5636625a61db20500a51418227316b34b.zip |
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
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 7 |
1 files 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(); } |