summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 05:39:36 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-20 05:39:36 +0000
commitffabf2702045193785ac169d75a851b36b9e4f00 (patch)
treeed540eaafa2209f29bc2c4d77fb25deb2a329d8f /crawl-ref/source/stuff.cc
parent05b5a380396d451918b1838fffb16d0b5a5ccdbd (diff)
downloadcrawl-ref-ffabf2702045193785ac169d75a851b36b9e4f00.tar.gz
crawl-ref-ffabf2702045193785ac169d75a851b36b9e4f00.zip
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
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r--crawl-ref/source/stuff.cc24
1 files 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);
}