summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 00:34:22 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-18 00:34:22 +0000
commit6817824379462ee5a1aab8267eb437d2b543504e (patch)
treede5fdb811964e1ae9baa86f8d78f19dc99f26a28 /crawl-ref/source/spl-book.cc
parentb5890e8e1fde868016e260b98170e00c67947601 (diff)
downloadcrawl-ref-6817824379462ee5a1aab8267eb437d2b543504e.tar.gz
crawl-ref-6817824379462ee5a1aab8267eb437d2b543504e.zip
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
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc3
1 files changed, 1 insertions, 2 deletions
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);