From 2945d473b0caecec08477ea475f4c0289fd3a373 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 2 Jun 2007 06:47:02 +0000 Subject: [1728745] When reading books, exiting from a spell description leaves you in the spell listing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1506 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/item_use.cc | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'crawl-ref/source/item_use.cc') diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 80cd805a18..278be8f1b2 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3173,33 +3173,30 @@ static void handle_read_book( int item_slot ) skill_manual(item_slot); return; } - else + + while (true) { // Spellbook spell = read_book( you.inv[item_slot], RBOOK_READ_SPELL ); - } - if (spell < 'a' || spell > 'h') //jmf: was 'g', but 8=h - { - mesclr( true ); - return; - } - - spell_index = letter_to_index( spell ); + if (spell < 'a' || spell > 'h') //jmf: was 'g', but 8=h + { + mesclr( true ); + return; + } - spell_type nthing = - which_spell_in_book(you.inv[item_slot].sub_type, spell_index); - if (nthing == SPELL_NO_SPELL) - { - mesclr( true ); - return; - } + spell_index = letter_to_index( spell ); - describe_spell( nthing ); - redraw_screen(); + const spell_type nthing = + which_spell_in_book(you.inv[item_slot].sub_type, spell_index); + if (nthing == SPELL_NO_SPELL) + { + mesclr( true ); + return; + } - mesclr( true ); - return; + describe_spell( nthing ); + } } void read_scroll(void) -- cgit v1.2.3-54-g00ecf