summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-06-19 16:05:04 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-06-22 10:03:45 -0400
commit465957cba490a2a9d5444a64523572a90cfb837f (patch)
tree536c94ce0702e60217120aa2bb27325aff1b8f2d /crawl-ref/source/traps.cc
parent393eda0d444702a7eda580e6c363bbdcaba8d54e (diff)
downloadcrawl-ref-465957cba490a2a9d5444a64523572a90cfb837f.tar.gz
crawl-ref-465957cba490a2a9d5444a64523572a90cfb837f.zip
The great mon-stuff migration.
A good deal of functions move to the two new files, mon-poly and mon-message. Of the others, some go to where they are used, some to mon-util, and a few are made member methods of monster. This probably breaks Xcode compilation, and I'm not able to test the changes I made to MSVC that will (hopefully) keep it working.
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index 84136bcc1a..2ee17cc54a 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -33,7 +33,6 @@
#include "message.h"
#include "misc.h"
#include "mon-death.h"
-#include "mon-stuff.h"
#include "mon-transit.h"
#include "mon-util.h"
#include "ouch.h"
@@ -1434,6 +1433,18 @@ void free_self_from_net()
}
}
+void mons_clear_trapping_net(monster* mon)
+{
+ if (!mon->caught())
+ return;
+
+ const int net = get_trapping_net(mon->pos());
+ if (net != NON_ITEM)
+ free_stationary_net(net);
+
+ mon->del_ench(ENCH_HELD, true);
+}
+
void free_stationary_net(int item_index)
{
item_def &item = mitm[item_index];