diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-17 08:11:52 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-17 08:11:52 +0000 |
commit | 0ffe1315339223ae3b68b79ff2a68fbb3665a865 (patch) | |
tree | 8c8be438e0787879fdb07c622b09399236e5c822 /crawl-ref/source/food.cc | |
parent | 0a69a524938f8c559947685b901abdb22043925b (diff) | |
download | crawl-ref-0ffe1315339223ae3b68b79ff2a68fbb3665a865.tar.gz crawl-ref-0ffe1315339223ae3b68b79ff2a68fbb3665a865.zip |
Apply Haran's fixes (r6577) to 0.4.1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6582 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 15577ae30e..8aac6e201f 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<food_type>(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; } |