diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-13 14:54:20 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-13 15:22:16 +0100 |
commit | d4189cb0308511fc5d7e12790993f6844974e0c7 (patch) | |
tree | a45cdd89702f1110fbe94a70db99ddbebd0e5f45 /crawl-ref/source/actor-los.cc | |
parent | cc0860dfeac4c0f9917d3e96fd9b709df1fafff2 (diff) | |
download | crawl-ref-d4189cb0308511fc5d7e12790993f6844974e0c7.tar.gz crawl-ref-d4189cb0308511fc5d7e12790993f6844974e0c7.zip |
Hack player LOS routines for arena.
Player now sees everything in the arena.
Diffstat (limited to 'crawl-ref/source/actor-los.cc')
-rw-r--r-- | crawl-ref/source/actor-los.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crawl-ref/source/actor-los.cc b/crawl-ref/source/actor-los.cc index 06eb063a13..bc7f1c4868 100644 --- a/crawl-ref/source/actor-los.cc +++ b/crawl-ref/source/actor-los.cc @@ -4,10 +4,12 @@ #include "player.h" #include "monster.h" #include "state.h" +#include "viewgeom.h" bool actor::observable() const { - return (crawl_state.arena || this == &you || you.can_see(this)); + return (crawl_state.arena && this != &you + || this == &you || you.can_see(this)); } bool actor::see_cell(const coord_def &p) const @@ -52,3 +54,20 @@ void player::update_los() actor::update_los(); } +// Player LOS overrides for arena. + +bool player::see_cell(const coord_def &c) const +{ + if (crawl_state.arena) + return (crawl_view.in_grid_los(c)); + else + return (actor::see_cell(c)); +} + +bool player::can_see(const actor* a) const +{ + if (crawl_state.arena) + return (see_cell(a->pos())); + else + return (actor::can_see(a)); +} |