From fd5880c67a1c7c78fbb21e0418f89f2e9e3b619a Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 7 Jun 2009 20:26:00 +0000 Subject: Fix [2777866]: Don't automatically target monster types that give no experience (i.e., plants and fungi). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9914 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index e24ddacbb8..073565e368 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1924,6 +1924,11 @@ bool in_los(const coord_def& pos) static bool _mons_is_valid_target(const monsters *mon, int mode, int range) { + // Monster types that you can't gain experience from don't count as + // monsters. + if (mons_class_flag(mon->type, M_NO_EXP_GAIN)) + return (false); + // Unknown mimics don't count as monsters, either. if (mons_is_mimic(mon->type) && !(mon->flags & MF_KNOWN_MIMIC)) @@ -1934,10 +1939,10 @@ static bool _mons_is_valid_target(const monsters *mon, int mode, int range) // Don't usually target unseen monsters... if (!player_monster_visible(mon)) { - // ... unless it creates a "disturbance in the water". + // ...unless it creates a "disturbance in the water". // Since you can't see the monster, assume it's not a friend. - // Also don't target submerged monsters if there are other targets - // in sight. (This might be too restrictive.) + // Also, don't target submerged monsters if there are other + // targets in sight. (This might be too restrictive.) return (mode != TARG_FRIEND && _mon_submerged_in_water(mon) && i_feel_safe(false, false, true, range)); -- cgit v1.2.3-54-g00ecf