From ed4a22bce4db2328e945840901176b49d4b573e7 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Wed, 21 Oct 2009 16:07:05 +0200 Subject: Introduce actor::see_cell. Implemented using the existing LOS functions for now. In particular, monster-monster visibility still uses num_feats_between. --- crawl-ref/source/player.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 3892682d80..452c16a57c 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7362,16 +7362,17 @@ bool player::visible_to(const actor *looker) const return mons_player_visible(mon); } +bool player::see_cell(const coord_def &c) const +{ + return (::see_cell(c)); +} + bool player::can_see(const actor *target) const { if (crawl_state.arena) return target->visible_to(this); - if (this == target) - return visible_to(target); - - const monsters* mon = dynamic_cast(target); - return (mons_near(mon) && target->visible_to(this)); + return (target->visible_to(this) && see_cell(target->pos())); } bool player::backlit(bool check_haloed) const -- cgit v1.2.3-54-g00ecf