From e14b5260df1fa0e9400a1d0c3472f5d8dcc97e89 Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 16 Jul 2008 23:45:54 +0000 Subject: Fix 2019860: beef jerky wasn't considered meat. Fix 2019581: weapon flavour was flowing through to subsequent attacks. Fix 2001572: persistent --more-- after dying to explosions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6577 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/food.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/food.cc') diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 0723e53728..44f39bdb5a 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1916,9 +1916,9 @@ bool causes_rot(const item_def &food) } // Returns 1 for herbivores, -1 for carnivores and 0 for either. -static int _player_likes_food_type(int food_type) +static int _player_likes_food_type(int type) { - switch (food_type) + switch (static_cast(type)) { case FOOD_BREAD_RATION: case FOOD_PEAR: @@ -1941,10 +1941,19 @@ static int _player_likes_food_type(int food_type) case FOOD_CHUNK: case FOOD_MEAT_RATION: case FOOD_SAUSAGE: + case FOOD_BEEF_JERKY: return -1; + + case FOOD_HONEYCOMB: + case FOOD_ROYAL_JELLY: + return 0; + + case NUM_FOODS: + mpr("Bad food type", MSGCH_ERROR); + return 0; } - // Anything missing? + mprf(MSGCH_ERROR, "Couldn't handle food type: %d"); return 0; } -- cgit v1.2.3-54-g00ecf