diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-10-27 10:12:56 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-10-27 13:06:24 +0100 |
commit | 88b208ce6d41d2e9bf59a2b572a43d1f78ca3dd9 (patch) | |
tree | aad23d67dd0e7e065e870bcd1db520f1fc5e62de /crawl-ref/source/view.cc | |
parent | a518714cb8090a529986c8909a2aa02a2fc0717f (diff) | |
download | crawl-ref-88b208ce6d41d2e9bf59a2b572a43d1f78ca3dd9.tar.gz crawl-ref-88b208ce6d41d2e9bf59a2b572a43d1f78ca3dd9.zip |
Get rid of part of mons_near.
mons_near now only checks player proximity. Checking for foe
proximity is now handled by monsters::near_foe.
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index d7a03f82f3..e2a35e53c5 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3051,27 +3051,12 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, return (did_map); } -// Is the given monster near (in LOS of) the given foe's -// position (the player by default)? -bool mons_near(const monsters *monster, unsigned short foe) +// Is the given monster near (in LOS of) the player? +bool mons_near(const monsters *monster) { - // Early out -- no foe! - if (foe == MHITNOT) - return (false); - - if (foe == MHITYOU) - { - if (crawl_state.arena || crawl_state.arena_suspended) - return (true); - return (see_cell(monster->pos())); - } - - // Must be a monster. - const monsters *foemons = &menv[foe]; - if (foemons->alive()) - return (monster->mon_see_cell(foemons->pos())); - - return (false); + if (crawl_state.arena || crawl_state.arena_suspended) + return (true); + return (see_cell(monster->pos())); } bool mon_enemies_around(const monsters *monster) |