summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-28 13:58:05 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-28 13:58:05 +0000
commitab53d4cf731ac6b5106910e6f9ea808922e6138a (patch)
treec7fee2ba56dea07c82c6987ca813879beb08fbe0 /crawl-ref/source/monstuff.cc
parentf20f0c27dc2a71afb6433f905d9709565d2f5204 (diff)
downloadcrawl-ref-ab53d4cf731ac6b5106910e6f9ea808922e6138a.tar.gz
crawl-ref-ab53d4cf731ac6b5106910e6f9ea808922e6138a.zip
Added a sanity check for followers to prevent frozen monsters (cbus). Still need to figure out why monsters are getting marked as followers when they shouldn't.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2241 c06c8d41-db1a-0410-9941-cceddc491573
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