diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-17 22:04:34 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-09-17 22:04:34 +0000 |
commit | aeb4ec07c472d019e92cd769bbd6484439aa7f86 (patch) | |
tree | 03c4c044279ea4ce43e39311cf820d5b4237adc5 /crawl-ref/source/misc.cc | |
parent | d636d3368b6441379025477373212cd203fe16bf (diff) | |
download | crawl-ref-aeb4ec07c472d019e92cd769bbd6484439aa7f86.tar.gz crawl-ref-aeb4ec07c472d019e92cd769bbd6484439aa7f86.zip |
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
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 12 |
1 files changed, 8 insertions, 4 deletions
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) |