Skip to content

Commit

Permalink
Make friendly monsters follow you unless under attack (#50864)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltank authored Aug 18, 2021
1 parent c148aed commit 7608106
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/monmove.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ void monster::plan()
}
} else if( friendly != 0 && !docile ) {
for( monster &tmp : g->all_monsters() ) {
if( tmp.friendly == 0 && seen_levels.test( tmp.pos().z + OVERMAP_DEPTH ) ) {
if( tmp.friendly == 0 && tmp.attitude_to( *this ) == Attitude::HOSTILE &&
seen_levels.test( tmp.pos().z + OVERMAP_DEPTH ) ) {
float rating = rate_target( tmp, dist, smart_planning );
if( rating < dist ) {
target = &tmp;
Expand Down

0 comments on commit 7608106

Please sign in to comment.