diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-18 14:47:37 +0200 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-18 14:48:43 +0200 |
commit | 16fdd3ec806d87ba783db05ed0ba1290bcbb3959 (patch) | |
tree | a093db078aca57fbaa4b20b854e4400da1227458 /crawl-ref/source/los.cc | |
parent | 1a0813b58a1b1684366a2e0e98243c35ae4c5797 (diff) | |
download | crawl-ref-16fdd3ec806d87ba783db05ed0ba1290bcbb3959.tar.gz crawl-ref-16fdd3ec806d87ba783db05ed0ba1290bcbb3959.zip |
Fix see_cell for tighter ENV_SHOW_OFFSET.
This was causing see_cell to fail for cells at the edge of LOS.
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r-- | crawl-ref/source/los.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 1a34f84f34..5c9f9b74c6 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -951,7 +951,7 @@ bool see_cell(const env_show_grid &show, return (true); const coord_def ip = pos - c; - if (ip.rdist() < ENV_SHOW_OFFSET) + if (ip.rdist() <= ENV_SHOW_OFFSET) { const coord_def sp(ip + coord_def(ENV_SHOW_OFFSET, ENV_SHOW_OFFSET)); if (show(sp)) @@ -963,9 +963,9 @@ bool see_cell(const env_show_grid &show, // Answers the question: "Is a cell within character's line of sight?" bool see_cell(const coord_def &p) { - return ((crawl_state.arena || crawl_state.arena_suspended) + return (((crawl_state.arena || crawl_state.arena_suspended) && crawl_view.in_grid_los(p)) - || see_cell(env.show, you.pos(), p); + || see_cell(env.show, you.pos(), p)); } // Answers the question: "Would a cell be within character's line of sight, |