summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/actor.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-06 21:09:35 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-07 07:13:17 +0100
commit10273d633986cf417c52169acb14a12fc52cb018 (patch)
tree191d249b808d70172f72633c55e2e4979783df8c /crawl-ref/source/actor.cc
parenta8aa8b394e1419e367eda8774d47c4c79c0aa2ea (diff)
downloadcrawl-ref-10273d633986cf417c52169acb14a12fc52cb018.tar.gz
crawl-ref-10273d633986cf417c52169acb14a12fc52cb018.zip
Give actors their own LOS.
Diffstat (limited to 'crawl-ref/source/actor.cc')
-rw-r--r--crawl-ref/source/actor.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/actor.cc b/crawl-ref/source/actor.cc
index efc56962ef..705a492221 100644
--- a/crawl-ref/source/actor.cc
+++ b/crawl-ref/source/actor.cc
@@ -17,6 +17,16 @@ bool actor::observable() const
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
{
return (target->visible_to(this) && see_cell(target->pos()));
@@ -118,4 +128,5 @@ bool actor::check_res_magic(int power)
void actor::set_position(const coord_def &c)
{
position = c;
+ los.set_center(c);
}