diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-21 16:07:05 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-22 22:37:07 +0200 |
commit | ed4a22bce4db2328e945840901176b49d4b573e7 (patch) | |
tree | 3ad9ac52b5b24dca8dd5317e7b7468d11c09db58 /crawl-ref/source/player.cc | |
parent | 07ef1ffe1ce0431004b79ede171f3f6bfa16549f (diff) | |
download | crawl-ref-ed4a22bce4db2328e945840901176b49d4b573e7.tar.gz crawl-ref-ed4a22bce4db2328e945840901176b49d4b573e7.zip |
Introduce actor::see_cell.
Implemented using the existing LOS functions for now. In particular,
monster-monster visibility still uses num_feats_between.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 11 |
1 files changed, 6 insertions, 5 deletions
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<const monsters*>(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 |