cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
688 stars 271 forks source link

Obligate carnivores can eat garlic cloves (but not garlic bulbs) #135

Closed Soadreqm closed 2 years ago

Soadreqm commented 4 years ago

Describe the bug

A character with the "Carnivore" mutation can eat raw garlic cloves, while garlic bulbs are described as "inedible plantstuff".

Steps To Reproduce

  1. Get the "Carnivore" mutation
  2. Obtain a garlic bulb, note that it is inedible
  3. Break the bulb down into cloves
  4. Eat the cloves

Expected behavior

Garlic should be either always edible or always inedible. It hardly matters which, given how little nutritional value it has. I just thought it was odd, since both seem to be made of the same "garlic" material.

Screenshots

cata_garlic

Versions and configuration

Coolthulhu commented 4 years ago

There are also different kinds of food that lack the proper tags. Oatmeal is one such thing, but only before cooking.

It should be easy to make a list of comestibles with no materials and no allergy tags.

Relgar commented 2 years ago

As per consumption.cpp, line 697:

if( has_trait( trait_CARNIVORE ) && nutrition_for( food ) > 0 &&
    food.has_any_flag( carnivore_blacklist ) && !food.has_flag( flag_CARNIVORE_OK ) ) {
    return ret_val<edible_rating>::make_failure( edible_rating::inedible_mutation,
            _( "Eww.  Inedible plant stuff!" ) );
}

According to @Coolthulhu , because garlic cloves have a kcal of 4, this is failing nutrition_for, which should be replaced with just compute_effective_nutrients( comest ).kcal > 0, which is what nutrition_for is calling.