Skip to content

Commit

Permalink
Non-player faction NPCs need no food. (#72296)
Browse files Browse the repository at this point in the history
* Non-player faction NPCs need no food.

* clang-tidy
  • Loading branch information
wwkk222208 authored Mar 10, 2024
1 parent 4b802fa commit 1f4f45c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4970,7 +4970,9 @@ float Character::activity_level() const

bool Character::needs_food() const
{
return !( is_npc() && get_option<bool>( "NO_NPC_FOOD" ) );
// Before the mechanism for non-player faction NPCs to obtain food is set up, it is unreasonable to require them to consume food.
return ( !get_option<bool>( "NO_NPC_FOOD" ) && get_faction() == get_avatar().get_faction() ) ||
!is_npc();
}

void Character::update_needs( int rate_multiplier )
Expand Down

0 comments on commit 1f4f45c

Please sign in to comment.