summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc46
1 files changed, 19 insertions, 27 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 598aa55dc0..984dc715b8 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2930,8 +2930,6 @@ int check_stealth(void)
void ability_increase(void)
{
- unsigned char keyin;
-
mpr("Your experience leads to an increase in your attributes!",
MSGCH_INTRINSIC_GAIN);
@@ -2940,34 +2938,28 @@ void ability_increase(void)
mpr("Increase (S)trength, (I)ntelligence, or (D)exterity? ", MSGCH_PROMPT);
- get_key:
- keyin = getch();
- if (keyin == 0)
- {
- getch();
- goto get_key;
- }
-
- switch (keyin)
+ while (true)
{
- case 's':
- case 'S':
- modify_stat(STAT_STRENGTH, 1, false);
- return;
+ const int keyin = getch();
- case 'i':
- case 'I':
- modify_stat(STAT_INTELLIGENCE, 1, false);
- return;
-
- case 'd':
- case 'D':
- modify_stat(STAT_DEXTERITY, 1, false);
- return;
+ switch (keyin)
+ {
+ case 's':
+ case 'S':
+ modify_stat(STAT_STRENGTH, 1, false);
+ return;
+
+ case 'i':
+ case 'I':
+ modify_stat(STAT_INTELLIGENCE, 1, false);
+ return;
+
+ case 'd':
+ case 'D':
+ modify_stat(STAT_DEXTERITY, 1, false);
+ return;
+ }
}
-
- goto get_key;
-/* this is an infinite loop because it is reasonable to assume that you're not going to want to leave it prematurely. */
} // end ability_increase()
void display_char_status()