summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-24 18:44:55 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-24 18:44:55 +0000
commitcef2c17b4efb995e002c07062c04254055277d55 (patch)
tree7cb8d05cfc08c75e0594d649675340bb6451b937 /crawl-ref/source/directn.cc
parentde1e3653a03844e6c19246d9cc8f1bce3a4d98aa (diff)
downloadcrawl-ref-cef2c17b4efb995e002c07062c04254055277d55.tar.gz
crawl-ref-cef2c17b4efb995e002c07062c04254055277d55.zip
Partial fix for [2628480]: use you.can_see() instead of
player_monster_visible() in monsters::name() and do_mon_str_replacements(), so that noninvisible monsters which shout when out of sight are handled correctly. This isn't really the bug that's there, but it needed to be done sometime. Note that this is a change: if a monster is too far away to see and you want to get its name, you'll have to set force_vis. I hope this doesn't break anything. Also, make the mgrd-out-of-sync message trigger outside of DEBUG_DIAGNOSTICS. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9195 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index f3eed0efec..c75aa88657 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -267,7 +267,7 @@ static void draw_ray_glyph(const coord_def &pos, int colour,
{
if (mons->alive() && player_monster_visible(mons))
{
- glych = get_screen_glyph(pos.x, pos.y);
+ glych = get_screen_glyph(pos);
colour = mcol;
}
}
@@ -413,13 +413,10 @@ static void _direction_again(dist& moves, targeting_type restricts,
{
const monsters *montarget = &menv[you.prev_targ];
- if (!mons_near(montarget)
- || !player_monster_visible( montarget ))
+ if (!you.can_see(montarget))
{
moves.isCancel = true;
-
crawl_state.cancel_cmd_all("Your target is gone.");
-
return;
}
else if (!_is_target_in_range(montarget->pos(), range))