summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 11:32:57 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-26 11:32:57 +0000
commitce6a7efb9404d67af78ecd3a42d2e4f430b8cbab (patch)
tree9faeef5b828dc92839f8320a2e4b8e3af8c810e9 /crawl-ref/source/traps.cc
parentf2341f8e9711e2154a826e85e28280d02337dc36 (diff)
downloadcrawl-ref-ce6a7efb9404d67af78ecd3a42d2e4f430b8cbab.tar.gz
crawl-ref-ce6a7efb9404d67af78ecd3a42d2e4f430b8cbab.zip
Fix bug 1814617: teleport/banish not clearing being trapped in net
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2588 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/traps.cc')
-rw-r--r--crawl-ref/source/traps.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc
index ce38b939d5..aa513293b1 100644
--- a/crawl-ref/source/traps.cc
+++ b/crawl-ref/source/traps.cc
@@ -780,6 +780,18 @@ void free_self_from_net()
}
}
+void clear_trapping_net()
+{
+ if (!you.attribute[ATTR_HELD])
+ return;
+
+ const int net = get_trapping_net(you.x_pos, you.y_pos);
+ if (net != NON_ITEM)
+ remove_item_stationary(mitm[net]);
+
+ you.attribute[ATTR_HELD] = 0;
+}
+
bool trap_item(object_class_type base_type, char sub_type,
char beam_x, char beam_y)
{