From ffabf2702045193785ac169d75a851b36b9e4f00 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 20 Dec 2008 05:39:36 +0000 Subject: Attempt to make stair-tagging of adjacent monsters work properly when monsters that can't use stairs are between them and the player. Be warned: this is somewhat hackish. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7878 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/stuff.cc | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index e487c3c568..0c3576e2be 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -341,7 +341,6 @@ static bool tag_follower_at(const coord_def &pos) monsters *fmenv = &menv[mgrd(pos)]; if (!fmenv->alive() - || !fmenv->can_use_stairs() || fmenv->incapacitated() || mons_is_stationary(fmenv)) { @@ -378,18 +377,25 @@ static bool tag_follower_at(const coord_def &pos) } } - // Monster is chasing player through stairs. - fmenv->flags |= MF_TAKING_STAIRS; + // Return true for monsters that can't use stairs (so that friendly + // monsters adjacent to them can still follow you through stairs), + // but don't tag them as followers. + if (fmenv->can_use_stairs()) + { + // Monster is chasing player through stairs. + fmenv->flags |= MF_TAKING_STAIRS; - // Clear patrolling/travel markers. - fmenv->patrol_point.reset(); - fmenv->travel_path.clear(); - fmenv->travel_target = MTRAV_NONE; + // Clear patrolling/travel markers. + fmenv->patrol_point.reset(); + fmenv->travel_path.clear(); + fmenv->travel_target = MTRAV_NONE; #if DEBUG_DIAGNOSTICS - mprf(MSGCH_DIAGNOSTICS, "%s is marked for following.", - fmenv->name(DESC_CAP_THE, true).c_str() ); + mprf(MSGCH_DIAGNOSTICS, "%s is marked for following.", + fmenv->name(DESC_CAP_THE, true).c_str() ); #endif + } + return (true); } -- cgit v1.2.3-54-g00ecf