summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 37709f9e40..5c3cf95dcd 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -35,6 +35,7 @@
#include "beam.h"
#include "cloud.h"
#include "debug.h"
+#include "delay.h"
#include "describe.h"
#include "dgnevent.h"
#include "fight.h"
@@ -5035,13 +5036,29 @@ forget_it:
// movement is towards the player. -- bwr
if (testbits( monster->flags, MF_TAKING_STAIRS ))
{
+ const delay_type delay = current_delay_action();
+ if (delay != DELAY_ASCENDING_STAIRS
+ && delay != DELAY_DESCENDING_STAIRS)
+ {
+ monster->flags &= ~MF_TAKING_STAIRS;
+
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS,
+ "BUG: %s was marked as follower when not following!",
+ monster->name(DESC_PLAIN).c_str());
+#endif
+ }
+ else
+ {
+ mmov_x = 0;
+ mmov_y = 0;
+
#if DEBUG_DIAGNOSTICS
- mprf(MSGCH_DIAGNOSTICS,
- "%s is skipping movement in order to follow.",
- monster->name(DESC_CAP_THE).c_str() );
+ mprf(MSGCH_DIAGNOSTICS,
+ "%s is skipping movement in order to follow.",
+ monster->name(DESC_CAP_THE).c_str() );
#endif
- mmov_x = 0;
- mmov_y = 0;
+ }
}
// check for attacking another monster