diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 02:56:30 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-09 02:56:30 +0000 |
commit | 6eb9841f76396644005a047518c775e7d867db62 (patch) | |
tree | 52809fd820b8966ac41abab4df2d663b5e5810d0 /crawl-ref/source/misc.cc | |
parent | 613b175f1baededdfddf46221e882dbdae8e5709 (diff) | |
download | crawl-ref-6eb9841f76396644005a047518c775e7d867db62.tar.gz crawl-ref-6eb9841f76396644005a047518c775e7d867db62.zip |
Move there_are_monsters_nearby() to misc.cc, and make it a wrapper
around get_playervisible_monsters(), in order to reduce code
duplication.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5630 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r-- | crawl-ref/source/misc.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index 342e7f96ae..c1115df870 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2759,6 +2759,15 @@ bool i_feel_safe(bool announce, bool want_move, bool just_monsters, int range) return (false); } +bool there_are_monsters_nearby() +{ + // Monster check. + std::vector<monsters*> visible; + get_playervisible_monsters(visible, false, true); + + return (!visible.empty()); +} + static const char *shop_types[] = { "weapon", "armour", |