Skip to content

Commit

Permalink
Merge pull request CleverRaven#75534 from p4nc4k3z/carnivore-low-cal-fix
Browse files Browse the repository at this point in the history
Fix for Carnivores being able to eat low-calorie veggies
  • Loading branch information
Maleclypse authored Aug 13, 2024
2 parents 2623fe2 + 7ec902e commit b8dba37
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/consumption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ std::pair<nutrients, nutrients> Character::compute_nutrient_range(

int Character::nutrition_for( const item &comest ) const
{
// Note: This will round down to zero for super-low-calorie foods
return compute_effective_nutrients( comest ).kcal() / islot_comestible::kcal_per_nutr;
}

Expand Down Expand Up @@ -901,7 +902,7 @@ ret_val<edible_rating> Character::can_eat( const item &food ) const
return ret_val<edible_rating>::make_failure( INEDIBLE_MUTATION, _( "Ugh, you can't drink that!" ) );
}

if( has_trait( trait_CARNIVORE ) && nutrition_for( food ) > 0 &&
if( has_trait( trait_CARNIVORE ) && compute_effective_nutrients( food ).kcal() > 0 &&
food.has_any_vitamin( carnivore_blacklist ) && !food.has_flag( flag_CARNIVORE_OK ) ) {
return ret_val<edible_rating>::make_failure( INEDIBLE_MUTATION,
_( "Eww. Inedible plant stuff!" ) );
Expand Down

0 comments on commit b8dba37

Please sign in to comment.