diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 16:29:24 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 17:01:14 +0100 |
commit | 6bdaccfb8c194bfa0bb0b6769babc3710d570b45 (patch) | |
tree | dce34efa2202539e5a8ea704cdaa46b17fd1969c /crawl-ref/source/actor.cc | |
parent | 19c3c95b8dba465b3efacf8eb96798af69c170fc (diff) | |
download | crawl-ref-6bdaccfb8c194bfa0bb0b6769babc3710d570b45.tar.gz crawl-ref-6bdaccfb8c194bfa0bb0b6769babc3710d570b45.zip |
Move see_cell_no_trans into player.
Also collect actor/player LOS code in actor-los.cc.
Diffstat (limited to 'crawl-ref/source/actor.cc')
-rw-r--r-- | crawl-ref/source/actor.cc | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc index 705a492221..90ff956d44 100644 --- a/crawl-ref/source/actor.cc +++ b/crawl-ref/source/actor.cc @@ -8,28 +8,13 @@ #include "stuff.h" #include "traps.h" -actor::~actor() -{ -} - -bool actor::observable() const +actor::actor() + : los_no_trans(los_def(coord_def(0,0), opacity_no_trans())) { - return (crawl_state.arena || this == &you || you.can_see(this)); } -bool actor::see_cell(const coord_def &p) const -{ - return (los.see_cell(p)); -} - -void actor::update_los() -{ - los.update(); -} - -bool actor::can_see(const actor *target) const +actor::~actor() { - return (target->visible_to(this) && see_cell(target->pos())); } bool actor::has_equipped(equipment_type eq, int sub_type) const @@ -129,4 +114,5 @@ void actor::set_position(const coord_def &c) { position = c; los.set_center(c); + los_no_trans.set_center(c); } |