diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-10 07:41:27 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-10 07:41:27 +0000 |
commit | aa3717c904d5d25c9f58f5d17e66379966f00a8f (patch) | |
tree | b0e55eb934017aada2332593ee8aa8979aeb9b58 /crawl-ref/source/itemname.cc | |
parent | 172979dfbcd139f1adba90624340e9e6e5184cae (diff) | |
download | crawl-ref-aa3717c904d5d25c9f58f5d17e66379966f00a8f.tar.gz crawl-ref-aa3717c904d5d25c9f58f5d17e66379966f00a8f.zip |
Move pickup_butcher_tool.txt into (the recently freed) pickup.lua,
re-enable it (whoops) and clean up its code.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5698 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 919db49454..82bddb848e 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2341,15 +2341,19 @@ bool is_dangerous_item(const item_def &item) bool is_useless_item(const item_def &item, bool temp) { - if (!item_type_known(item)) - return (false); - switch (item.base_type) { case OBJ_ARMOUR: return (!can_wear_armour(item, false, true)); + case OBJ_BOOKS: + return (item.sub_type != BOOK_DESTRUCTION + && item.sub_type != BOOK_MANUAL && you.religion == GOD_TROG); + case OBJ_SCROLLS: + if (!item_type_known(item)) + return (false); + // A bad item is always useless. if (is_bad_item(item)) return (true); @@ -2368,6 +2372,9 @@ bool is_useless_item(const item_def &item, bool temp) case OBJ_POTIONS: { + if (!item_type_known(item)) + return (false); + switch (item.sub_type) { case POT_CONFUSION: @@ -2410,6 +2417,9 @@ bool is_useless_item(const item_def &item, bool temp) return (false); } case OBJ_JEWELLERY: + if (!item_type_known(item)) + return (false); + if (is_bad_item(item)) return (true); |