summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-09 08:58:22 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-01-09 08:58:22 +0000
commit52b7f2716d2c217c1c0bbeb43c3c2f11d8e0c87e (patch)
tree6da531d3bcc1f9e8ab9cf92d457222d7f3318003
parentbca7bf95401a93f8dfff4595a4d106c03e4d42b1 (diff)
downloadcrawl-ref-52b7f2716d2c217c1c0bbeb43c3c2f11d8e0c87e.tar.gz
crawl-ref-52b7f2716d2c217c1c0bbeb43c3c2f11d8e0c87e.zip
[1625227] animate_dead will not affect corpses being butchered.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@811 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/delay.cc15
-rw-r--r--crawl-ref/source/delay.h2
-rw-r--r--crawl-ref/source/spells2.cc4
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);