summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-02 06:47:02 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-06-02 06:47:02 +0000
commit2945d473b0caecec08477ea475f4c0289fd3a373 (patch)
treece3b160e6f8958d505e7f0916ba1a21ec0145530 /crawl-ref/source/item_use.cc
parent336dafbe86c3b8f95d70766fcc0b10cefe715cd0 (diff)
downloadcrawl-ref-2945d473b0caecec08477ea475f4c0289fd3a373.tar.gz
crawl-ref-2945d473b0caecec08477ea475f4c0289fd3a373.zip
[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
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc37
1 files changed, 17 insertions, 20 deletions
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)