diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-24 18:44:55 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-02-24 18:44:55 +0000 |
commit | cef2c17b4efb995e002c07062c04254055277d55 (patch) | |
tree | 7cb8d05cfc08c75e0594d649675340bb6451b937 /crawl-ref/source/monstuff.cc | |
parent | de1e3653a03844e6c19246d9cc8f1bce3a4d98aa (diff) | |
download | crawl-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/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index cf51843c19..90efb07d3b 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -598,8 +598,7 @@ static bool _ely_protect_ally(monsters *monster) if (mons_holiness(monster) != MH_NATURAL && mons_holiness(monster) != MH_HOLY || !mons_friendly(monster) - || !mons_near(monster) - || !player_monster_visible(monster) // for simplicity + || !you.can_see(monster) // for simplicity || !one_chance_in(20)) { return (false); @@ -5714,7 +5713,7 @@ static bool _handle_special_ability(monsters *monster, bolt & beem) noisy(12, monster->pos(), NULL, true); bool did_resist = false; - if (player_monster_visible(monster)) + if (you.can_see(monster)) { simple_monster_message(monster, make_stringf(" chants %s song.", |