summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 6b9a0f7158..1553b85763 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6019,23 +6019,21 @@ bool player::invisible() const
return (duration[DUR_INVIS] && !backlit());
}
-bool player::visible_to(actor *looker)
+bool player::visible_to(const actor *looker) const
{
if (this == looker)
return (!invisible() || can_see_invisible());
- monsters* mon = dynamic_cast<monsters*>(looker);
-
+ const monsters* mon = dynamic_cast<const monsters*>(looker);
return mons_player_visible(mon);
}
-bool player::can_see(actor *target)
+bool player::can_see(const actor *target) const
{
if (this == target)
return visible_to(target);
- monsters* mon = dynamic_cast<monsters*>(target);
-
+ const monsters* mon = dynamic_cast<const monsters*>(target);
return (mons_near(mon) && target->visible_to(this));
}