diff options
author | Eduardo Gonzalez <ed.gonzalez3@gmail.com> | 2014-04-29 00:16:42 -0700 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-04-30 02:28:05 +0100 |
commit | 4630a0305fc422d85376cb8e3bcde7554a894efc (patch) | |
tree | 3245e54bb88a2a0d77959e436dc7899fcf0fae12 /crawl-ref/source/l_item.cc | |
parent | 65a72bc1f823d280e6b1fae40e9bf6e2a3fec3f3 (diff) | |
download | crawl-ref-4630a0305fc422d85376cb8e3bcde7554a894efc.tar.gz crawl-ref-4630a0305fc422d85376cb8e3bcde7554a894efc.zip |
Mark potions that are preferred food as food for prefix & stash search (#8461)
This affects porridge for most races and blood for vampires, though since
everything in the actual food class is usually irrelevant as "food" for
vampires, they're probably better off searching for blood anyways.
Expose is_preferred_food to lua for the stash annotation code.
Diffstat (limited to 'crawl-ref/source/l_item.cc')
-rw-r--r-- | crawl-ref/source/l_item.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index 8f60996b75..c093419375 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -572,6 +572,16 @@ IDEF(can_cut_meat) return 1; } +IDEF(is_preferred_food) +{ + if (!item || !item->defined()) + return 0; + + lua_pushboolean(ls, is_preferred_food(*item)); + + return 1; +} + IDEF(is_bad_food) { if (!item || !item->defined()) @@ -1142,6 +1152,7 @@ static ItemAccessor item_attrs[] = { "dropped", l_item_dropped }, { "is_melded", l_item_is_melded }, { "can_cut_meat", l_item_can_cut_meat }, + { "is_preferred_food", l_item_is_preferred_food }, { "is_bad_food", l_item_is_bad_food }, { "is_useless", l_item_is_useless }, { "pluses", l_item_pluses }, |