From 88b208ce6d41d2e9bf59a2b572a43d1f78ca3dd9 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Tue, 27 Oct 2009 10:12:56 +0100 Subject: 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. --- crawl-ref/source/view.cc | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'crawl-ref/source/view.cc') 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) -- cgit v1.2.3-54-g00ecf