summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-09 05:51:59 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-09 05:51:59 +0000
commit2356c9d5d86c48e5c8397eb88654ab85793650ed (patch)
treea79c860485f7b602d7c9046bd4f8fde975e31373 /crawl-ref/source/player.cc
parent6af0738c8730e4a831f10259ebb9a24e8beea48d (diff)
downloadcrawl-ref-2356c9d5d86c48e5c8397eb88654ab85793650ed.tar.gz
crawl-ref-2356c9d5d86c48e5c8397eb88654ab85793650ed.zip
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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc26
1 files changed, 24 insertions, 2 deletions
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;