diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-04 13:22:42 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-04 13:22:42 +0000 |
commit | 8b94722a96bc1d9a060aced908429253621fe308 (patch) | |
tree | cc9f0347aaf33b3ddc0cf89631ca3f8ce929d490 /crawl-ref/source/delay.cc | |
parent | 55d2a46739afd9fca9bf8f49edbe2237ce53e690 (diff) | |
download | crawl-ref-8b94722a96bc1d9a060aced908429253621fe308.tar.gz crawl-ref-8b94722a96bc1d9a060aced908429253621fe308.zip |
Fix worn equipment drop bug for trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@556 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index 86aa71baf4..13d2968ee6 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -55,7 +55,9 @@ static bool is_parent_delay(int delay) // Lua macros can in theory perform any of the other delays, // including travel; in practise travel still assumes there can be // no parent delay. - return (delay == DELAY_TRAVEL || delay == DELAY_MACRO); + return (delay == DELAY_TRAVEL + || delay == DELAY_MACRO + || delay == DELAY_MULTIDROP); } static void push_delay(const delay_queue_item &delay) @@ -319,6 +321,13 @@ void handle_delay( void ) mpr( info, MSGCH_DIAGNOSTICS ); #endif + // delay.duration-- *must* be done before multidrop, because + // multidrop is now a parent delay, which means other delays + // can be pushed to the front of the queue, invalidating the + // "delay" reference here, and resulting in tons of debugging + // fun with valgrind. + delay.duration--; + switch ( delay.type ) { case DELAY_ARMOUR_ON: @@ -352,7 +361,6 @@ void handle_delay( void ) default: break; } - delay.duration--; } else { |