From bc63643a6c8bdc583694356f559f09b356d2c1c6 Mon Sep 17 00:00:00 2001 From: haranp Date: Mon, 9 Jul 2007 12:38:44 +0000 Subject: Minor refactoring. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1817 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/newgame.cc | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'crawl-ref/source/newgame.cc') 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() -- cgit v1.2.3-54-g00ecf