Skip to content

Commit

Permalink
don't follow the player id MF_PET_WONT_FOLLOW flag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
eltank committed Aug 18, 2021
1 parent 78a69fd commit 5a2d5fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ void monster::plan()
Character &player_character = get_player_character();
// If we can see the player, move toward them or flee, simpleminded animals are too dumb to follow the player.
if( friendly == 0 && seen_levels.test( player_character.pos().z + OVERMAP_DEPTH ) &&
sees( player_character ) && !has_flag( MF_PET_WONT_FOLLOW ) ) {
sees( player_character ) ) {
dist = rate_target( player_character, dist, smart_planning );
fleeing = fleeing || is_fleeing( player_character );
target = &player_character;
Expand Down Expand Up @@ -634,7 +634,7 @@ void monster::plan()
} else if( friendly > 0 && one_in( 3 ) ) {
// Grow restless with no targets
friendly--;
} else if( friendly < 0 && sees( player_character ) ) {
} else if( friendly < 0 && sees( player_character ) && !has_flag( MF_PET_WONT_FOLLOW ) ) {
if( rl_dist( pos(), player_character.pos() ) > 2 ) {
set_dest( player_character.pos() );
} else {
Expand Down

0 comments on commit 5a2d5fa

Please sign in to comment.