From aeb4ec07c472d019e92cd769bbd6484439aa7f86 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 17 Sep 2009 22:04:34 +0000 Subject: Add a check for whether a monster with water habitat can reach the player and only consider such monster unsafe if there is a path. Replace the old runrest_ignore_monster checks for aquatic monsters with this one, which has the side effect of being nicer to Merfolk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10701 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/misc.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/misc.cc') diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 177e235569..26d5a59a00 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2703,10 +2703,14 @@ bool mons_is_safe(const monsters *mon, bool want_move, // Wizmode skill setting enforces hiddenness. || you.skills[SK_STEALTH] > 27 && dist > 2 #endif - // Only seen through glass walls? - || !see_grid_no_trans(mon->pos()) - && !_mons_has_path_to_player(mon) - && !mons_has_los_attack(mon)); + // Only seen through glass walls or within water? + || (!see_grid_no_trans(mon->pos()) + || mons_class_habitat(mon->type) == HT_WATER + || mons_class_habitat(mon->type) == HT_LAVA) + && !_mons_has_path_to_player(mon) + && !mons_has_los_attack(mon) + && (!see_grid_no_trans(mon->pos()) + || !mons_has_ranged_attack(mon))); #ifdef CLUA_BINDINGS if (consider_user_options) -- cgit v1.2.3-54-g00ecf