diff options
-rw-r--r-- | crawl-ref/source/delay.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/delay.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/spells2.cc | 4 |
3 files changed, 20 insertions, 1 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index f3c3b7f4f6..1570cef9b6 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -258,6 +258,21 @@ bool is_run_delay(int delay) || delay == DELAY_TRAVEL); } +bool is_being_butchered(const item_def &item) +{ + if (!you_are_delayed()) + return (false); + + const delay_queue_item &delay = you.delay_queue.front(); + if (delay.type == DELAY_BUTCHER) + { + const item_def &corpse = mitm[ delay.parm1 ]; + return (&corpse == &item); + } + + return (false); +} + void handle_delay( void ) /***********************/ { diff --git a/crawl-ref/source/delay.h b/crawl-ref/source/delay.h index 6e8f8196d7..ed496aa9cc 100644 --- a/crawl-ref/source/delay.h +++ b/crawl-ref/source/delay.h @@ -21,6 +21,8 @@ int current_delay_action( void ); void handle_delay( void ); bool is_run_delay(int delay); +bool is_being_butchered(const item_def &item); + const char *activity_interrupt_name(activity_interrupt_type ai); activity_interrupt_type get_activity_interrupt(const std::string &); diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 9673214744..fa0348d4ec 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -28,6 +28,7 @@ #include "beam.h" #include "cloud.h" +#include "delay.h" #include "direct.h" #include "dungeon.h" #include "effects.h" @@ -340,7 +341,8 @@ int animate_dead( int power, int corps_beh, int corps_hit, int actual ) // This searches all the items on the ground for a corpse while (objl != NON_ITEM) { - if (mitm[objl].base_type == OBJ_CORPSES) + if (mitm[objl].base_type == OBJ_CORPSES + && !is_being_butchered(mitm[objl])) { number_raised += raise_corpse(objl, adx, ady, corps_beh, corps_hit, actual); |