Skip to content

Commit

Permalink
Stop friendly animals from stealing food from under the player's nose
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade authored and olanti-p committed Jan 12, 2021
1 parent 745aa70 commit 66ee906
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ bool mattack::eat_food( monster *z )
if( g->m.has_flag( "PLANT", p ) ) {
continue;
}
// Don't snap up food RIGHT under the player's nose.
if( z->friendly && rl_dist( g->u.pos(), p ) <= 2 ) {
continue;
}
auto items = g->m.i_at( p );
for( auto &item : items ) {
//Fun limit prevents scavengers from eating feces
Expand Down

0 comments on commit 66ee906

Please sign in to comment.