diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-20 19:00:52 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-20 19:00:52 +0000 |
commit | 8ad4f44fa747a32e0d476971beeaf2c0550f16e5 (patch) | |
tree | 4cb0fa4b6f7cfc3fd7068ebee1564e1ade6bb2a6 /crawl-ref/source/player.cc | |
parent | 2d4c05e46de7f35c454f1dfbf3892ad589038a58 (diff) | |
download | crawl-ref-8ad4f44fa747a32e0d476971beeaf2c0550f16e5.tar.gz crawl-ref-8ad4f44fa747a32e0d476971beeaf2c0550f16e5.zip |
Experimental mouse support for ncurses (enable with mouse_input=yes in
.crawlrc).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1610 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 46 |
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() |