Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Soadreqm opened this issue Oct 23, 2020 · 2 comments · Fixed by #1954
Closed

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

Soadreqm opened this issue Oct 23, 2020 · 2 comments · Fixed by #1954
Labels
bug easy Simple task that doesn't require understanding the code much

Comments

@Soadreqm
Copy link
Contributor

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

  • OS: Windows 10 Pro N 2004
  • Game Version: 6ff0a54 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    No Rail Stations [No_Rail_Stations]
    ]
@Coolthulhu
Copy link
Member

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.

@Coolthulhu Coolthulhu added the easy Simple task that doesn't require understanding the code much label Aug 23, 2021
@Relgar
Copy link
Contributor

Relgar commented Dec 25, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug easy Simple task that doesn't require understanding the code much
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants