summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index b428ea85b1..2e69a145c1 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -777,13 +777,9 @@ static void clear_clouds()
env.cgrid.init(EMPTY_CLOUD);
}
-static bool level_type_allows_followers(level_area_type type)
-{
- return (type == LEVEL_DUNGEON || type == LEVEL_PANDEMONIUM);
-}
-
static void grab_followers()
{
+ const bool can_follow = level_type_allows_followers(you.level_type);
for (int i = you.x_pos - 1; i < you.x_pos + 2; i++)
{
for (int j = you.y_pos - 1; j < you.y_pos + 2; j++)
@@ -808,11 +804,18 @@ static void grab_followers()
if (!testbits( fmenv->flags, MF_TAKING_STAIRS ))
continue;
+ if (!can_follow)
+ {
+ // Monster can't follow us, so clear the follower flag.
+ fmenv->flags &= ~MF_TAKING_STAIRS;
+ continue;
+ }
+
#if DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS, "%s is following.",
- fmenv->name(DESC_CAP_THE, true).c_str());
+ mprf(MSGCH_DIAGNOSTICS, "%s is following to %s.",
+ fmenv->name(DESC_CAP_THE, true).c_str(),
+ level_id::current().describe().c_str());
#endif
-
fmenv->set_transit(level_id::current());
fmenv->destroy_inventory();
monster_cleanup(fmenv);
@@ -865,7 +868,6 @@ bool load( dungeon_feature_type stair_taken, int load_mode,
{
grab_followers();
-
if (old_level_type == LEVEL_DUNGEON)
save_level( old_level, LEVEL_DUNGEON, where_were_you2 );
}