diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 12:38:44 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-09 12:38:44 +0000 |
commit | bc63643a6c8bdc583694356f559f09b356d2c1c6 (patch) | |
tree | b7b0f15bd0fcfaf3ef103c6250c099781a2f8503 /crawl-ref/source/newgame.cc | |
parent | bb6930c4b733afe63784e44792b47d08a7ece2d8 (diff) | |
download | crawl-ref-bc63643a6c8bdc583694356f559f09b356d2c1c6.tar.gz crawl-ref-bc63643a6c8bdc583694356f559f09b356d2c1c6.zip |
Minor refactoring.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1817 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/newgame.cc')
-rw-r--r-- | crawl-ref/source/newgame.cc | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index cd6af24030..e732397ab1 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -86,6 +86,7 @@ #include "randart.h" #include "skills.h" #include "skills2.h" +#include "spl-book.h" #include "spl-util.h" #include "stuff.h" #include "tutorial.h" @@ -479,31 +480,8 @@ static void give_starting_food() static void mark_starting_books() { for (int i = 0; i < ENDOFPACK; i++) - { if (is_valid_item(you.inv[i]) && you.inv[i].base_type == OBJ_BOOKS) - { - const int subtype = you.inv[i].sub_type; - - you.had_book[subtype] = true; - - // one for all, all for one - if (subtype == BOOK_MINOR_MAGIC_I || - subtype == BOOK_MINOR_MAGIC_II || - subtype == BOOK_MINOR_MAGIC_III) - { - you.had_book[BOOK_MINOR_MAGIC_I] = true; - you.had_book[BOOK_MINOR_MAGIC_II] = true; - you.had_book[BOOK_MINOR_MAGIC_III] = true; - } - - if (subtype == BOOK_CONJURATIONS_I || - subtype == BOOK_CONJURATIONS_II) - { - you.had_book[BOOK_CONJURATIONS_I] = true; - you.had_book[BOOK_CONJURATIONS_II] = true; - } - } - } + mark_had_book(you.inv[i].sub_type); } static void racialise_starting_equipment() |