From 8ad4f44fa747a32e0d476971beeaf2c0550f16e5 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Wed, 20 Jun 2007 19:00:52 +0000 Subject: 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 --- crawl-ref/source/player.cc | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'crawl-ref/source/player.cc') 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() -- cgit v1.2.3-54-g00ecf