From 2356c9d5d86c48e5c8397eb88654ab85793650ed Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 9 Dec 2007 05:51:59 +0000 Subject: Halt command repitions and macros when gaining a level. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3026 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 917f95518c..bd9d374cd9 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2706,6 +2706,26 @@ void level_change(bool skip_ability_increase) while (you.experience_level < 27 && you.experience > exp_needed(you.experience_level + 2)) { + bool skip_more = false; + + if (!skip_ability_increase) + { + if (crawl_state.is_replaying_keys() + || crawl_state.is_repeating_cmd()) + { + crawl_state.cancel_cmd_repeat(); + crawl_state.cancel_cmd_again(); + } + + if (is_processing_macro()) + flush_input_buffer(FLUSH_ABORT_MACRO); + } + else if (crawl_state.is_replaying_keys() + || crawl_state.is_repeating_cmd() || is_processing_macro()) + { + skip_more = true; + } + int hp_adjust = 0; int mp_adjust = 0; @@ -2715,7 +2735,8 @@ void level_change(bool skip_ability_increase) { mprf(MSGCH_INTRINSIC_GAIN, "Welcome back to level %d!", you.experience_level ); - more(); + if (!skip_more) + more(); // Gain back the hp and mp we lose in lose_level(). -- bwr inc_hp( 4, true ); @@ -2725,7 +2746,8 @@ void level_change(bool skip_ability_increase) { mprf(MSGCH_INTRINSIC_GAIN, "You are now a level %d %s!", you.experience_level, you.class_name ); - more(); + if (!skip_more) + more(); int brek = 0; -- cgit v1.2.3-54-g00ecf