From 6817824379462ee5a1aab8267eb437d2b543504e Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 18 Jan 2009 00:34:22 +0000 Subject: Consolidate checks for the player's being undead or a demonspawn into player_is_unholy(), a la mons_is_unholy(), and use it where possible. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8522 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spl-book.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crawl-ref/source/spl-book.cc') diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 93e291ba93..616a0a0c86 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1391,8 +1391,7 @@ bool learn_spell(int book) return (false); } - if ((you.is_undead || you.species == SP_DEMONSPAWN) - && spell_typematch(specspell, SPTYP_HOLY)) + if (player_is_unholy() && spell_typematch(specspell, SPTYP_HOLY)) { mpr("You can't use this type of magic!"); return (false); -- cgit v1.2.3-54-g00ecf