summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 08:12:03 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-20 08:12:03 +0000
commitd7f1dd21aacab1548caf9315b035a5cedab29c5f (patch)
tree9d7fc4f95a503ed189a5af39a4d36c8b903518c7 /crawl-ref/source/misc.cc
parent1733067254ea91e95f1e77015ec3fd71c6424186 (diff)
downloadcrawl-ref-d7f1dd21aacab1548caf9315b035a5cedab29c5f.tar.gz
crawl-ref-d7f1dd21aacab1548caf9315b035a5cedab29c5f.zip
Ignore non-spellcasting monsters behind glass walls for the purpose of
resting and exploring. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5147 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 31c4cbd86a..a3e8006ab6 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2580,8 +2580,11 @@ std::string cloud_name(cloud_type type)
bool mons_is_safe(const struct monsters *mon, bool want_move)
{
- bool is_safe = mons_wont_attack(mon)
- || mons_class_flag(mon->type, M_NO_EXP_GAIN);
+ bool is_safe = (mons_wont_attack(mon)
+ || mons_class_flag(mon->type, M_NO_EXP_GAIN)
+ // only seen through glass walls
+ || !see_grid_no_trans(mon->x, mon->y)
+ && !mons_has_ranged_spell(mon));
#ifdef CLUA_BINDINGS
bool moving = (!you.delay_queue.empty()