From 717b5469982b9393369e883ab6b27d5a22cfceb2 Mon Sep 17 00:00:00 2001 From: Neil Moore Date: Thu, 14 Aug 2014 16:15:14 -0400 Subject: Don't pretend bread is useful to felid liches (#8875) Rather than assuming all food is long-term useful for the temporarily undead, instead check what would happen if we weren't a lich. --- crawl-ref/source/itemname.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 5a33428c4d..3cdf118416 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -31,6 +31,7 @@ #include "libutil.h" #include "makeitem.h" #include "mon-util.h" +#include "newgame.h" // get_undead_state #include "notes.h" #include "output.h" #include "player.h" @@ -47,6 +48,7 @@ #include "throw.h" #include "transform.h" #include "unicode.h" +#include "unwind.h" static bool _is_random_name_space(char let); static bool _is_random_name_vowel(char let); @@ -3521,7 +3523,15 @@ bool is_useless_item(const item_def &item, bool temp) return false; if (!temp && you.form == TRAN_LICH) - return false; + { + // See what would happen if we were in our normal state. + unwind_var formsim(you.form, TRAN_NONE); + unwind_var lifesim(you.is_undead, + get_undead_state(you.species)); + + if (!is_inedible(item)) + return false; + } if (is_fruit(item) && you_worship(GOD_FEDHAS)) return false; -- cgit v1.2.3