diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-28 13:58:05 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-28 13:58:05 +0000 |
commit | ab53d4cf731ac6b5106910e6f9ea808922e6138a (patch) | |
tree | c7fee2ba56dea07c82c6987ca813879beb08fbe0 /crawl-ref/source | |
parent | f20f0c27dc2a71afb6433f905d9709565d2f5204 (diff) | |
download | crawl-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')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 27 | ||||
-rw-r--r-- | crawl-ref/source/stuff.cc | 2 |
2 files changed, 23 insertions, 6 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 diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 1b6afe54dd..62554faf59 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -147,7 +147,7 @@ void tag_followers( void ) #if DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "%s is marked for following.", fmenv->name(DESC_CAP_THE, true).c_str() ); -#endif +#endif } } } |