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/invent.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/invent.cc')
-rw-r--r-- | crawl-ref/source/invent.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 466352587e..bfd8a4ccaa 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -819,8 +819,8 @@ static bool _item_class_selected(const item_def &i, int selector) static bool _userdef_item_selected(const item_def &i, int selector) { #if defined(CLUA_BINDINGS) - const char *luafn = selector == OSEL_WIELD ? "ch_item_wieldable" : - NULL; + const char *luafn = selector == OSEL_WIELD ? "ch_item_wieldable" + : NULL; return (luafn && clua.callbooleanfn(false, luafn, "u", &i)); #else return (false); @@ -829,16 +829,19 @@ static bool _userdef_item_selected(const item_def &i, int selector) static bool _is_item_selected(const item_def &i, int selector) { - return _item_class_selected(i, selector) - || _userdef_item_selected(i, selector); + return (_item_class_selected(i, selector) + || _userdef_item_selected(i, selector)); } static void _get_inv_items_to_show(std::vector<const item_def*> &v, int selector) { for (int i = 0; i < ENDOFPACK; i++) { - if (is_valid_item(you.inv[i]) && _is_item_selected(you.inv[i], selector)) + if (is_valid_item(you.inv[i]) + && _is_item_selected(you.inv[i], selector)) + { v.push_back( &you.inv[i] ); + } } } |