summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.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/beam.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/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc
index 1f0896085f..31070006d1 100644
--- a/crawl-ref/source/beam.cc
+++ b/crawl-ref/source/beam.cc
@@ -3494,7 +3494,7 @@ void bolt::affect_player_enchantment()
if (thrower != KILL_YOU_MISSILE && !invalid_monster_index(beam_source))
{
monsters *mon = &menv[beam_source];
- if (!player_monster_visible(mon))
+ if (!you.can_see(mon))
{
mpr("Something tries to affect you, but you resist.");
need_msg = false;
@@ -4179,7 +4179,7 @@ void bolt::enchantment_affect_monster(monsters* mon)
if (is_sanctuary(mon->pos()) || is_sanctuary(you.pos()))
remove_sanctuary(true);
- set_attack_conducts(conducts, mon, player_monster_visible(mon));
+ set_attack_conducts(conducts, mon, you.can_see(mon));
if (you.religion == GOD_BEOGH
&& mons_species(mon->type) == MONS_ORC
@@ -4446,7 +4446,7 @@ void bolt::affect_monster(monsters* mon)
// It's not the player's fault if he didn't see the monster or
// the monster was caught in an unexpected blast of ?immolation.
const bool okay =
- (!player_monster_visible(mon)
+ (!you.can_see(mon)
|| aux_source == "reading a scroll of immolation"
&& !effect_known);
@@ -4500,7 +4500,7 @@ void bolt::affect_monster(monsters* mon)
mprf("The %s %s %s.",
name.c_str(),
engulfs ? "engulfs" : "hits",
- player_monster_visible(mon) ?
+ you.can_see(mon) ?
mon->name(DESC_NOCAP_THE).c_str() : "something");
}