summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-08-14 03:33:01 -0400
committerJesse Luehrs <doy@tozt.net>2014-08-14 03:40:41 -0400
commitf2d8537d7a41a4700029c8c8862a2a7c868b13f6 (patch)
tree95923b7bbc9040a7958f772de49a3f9de19fea06
parent00d6247dd3f9fdcd58df1d1e8ab13913566c4571 (diff)
downloadcrawl-ref-f2d8537d7a41a4700029c8c8862a2a7c868b13f6.tar.gz
crawl-ref-f2d8537d7a41a4700029c8c8862a2a7c868b13f6.zip
corpses are inedible for non-vamps if the chunks are inedible (5040)
-rw-r--r--crawl-ref/source/food.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 3fcd2ff80c..7ce4746423 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -1795,11 +1795,24 @@ bool is_inedible(const item_def &item)
return true;
}
- if (item.base_type == OBJ_CORPSES
- && (item.sub_type == CORPSE_SKELETON
- || you.species == SP_VAMPIRE && !mons_has_blood(item.mon_type)))
+ if (item.base_type == OBJ_CORPSES)
{
- return true;
+ if (item.sub_type == CORPSE_SKELETON)
+ return true;
+
+ if (you.species == SP_VAMPIRE)
+ {
+ if (!mons_has_blood(item.mon_type))
+ return true;
+ }
+ else
+ {
+ item_def chunk = item;
+ chunk.base_type = OBJ_FOOD;
+ chunk.sub_type = FOOD_CHUNK;
+ if (is_inedible(chunk))
+ return true;
+ }
}
return false;