From cef2c17b4efb995e002c07062c04254055277d55 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 24 Feb 2009 18:44:55 +0000 Subject: 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 --- crawl-ref/source/beam.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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"); } -- cgit v1.2.3-54-g00ecf