diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 10:12:37 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-08 10:12:37 +0100 |
commit | 06004d1b288fa90ba6e19ce6d76d06354365abda (patch) | |
tree | 389dc8213af2966abc32275338df8d1808e3836c /crawl-ref | |
parent | 6a883aea39bceefb34718c699ee3877d33b6d2ba (diff) | |
download | crawl-ref-06004d1b288fa90ba6e19ce6d76d06354365abda.tar.gz crawl-ref-06004d1b288fa90ba6e19ce6d76d06354365abda.zip |
Global inside_halo(c) giving list of haloers.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/halo.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crawl-ref/source/halo.cc b/crawl-ref/source/halo.cc index 555df0048b..daa80a728c 100644 --- a/crawl-ref/source/halo.cc +++ b/crawl-ref/source/halo.cc @@ -1,9 +1,12 @@ #include "AppHdr.h" +#include "halo.h" + #include "actor.h" #include "player.h" #include "monster.h" #include "religion.h" +#include "terrain.h" // TODO: generalize. bool actor::haloed() const @@ -32,3 +35,16 @@ int monsters::halo_radius() const { return 0; } + +std::list<actor*> inside_halo(const coord_def &c) +{ + std::list<actor*> haloers; + for (radius_iterator ri(c, LOS_RADIUS, false); ri; ++ri) + { + actor* a = actor_at(*ri); + if (a && a->inside_halo(c)) + haloers.push_back(a); + } + return (haloers); +} + |