summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-20 22:22:04 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-08-20 22:22:04 +0000
commit037b6326b7b553ff7610b9ef70207aee35d9defa (patch)
tree3cff8782010bb1450e5a31c377a40066d3db6404 /crawl-ref/source/items.cc
parent5b618acbca35621d699dc4ba3064f2a3228a5131 (diff)
downloadcrawl-ref-037b6326b7b553ff7610b9ef70207aee35d9defa.tar.gz
crawl-ref-037b6326b7b553ff7610b9ef70207aee35d9defa.zip
Throwing nets again.
Added a number of functions that allow to differentiate between a net that currently traps a monster and one that doesn't, even if they are on the same square. This usually works but can fail if there's already a net lying on the target square. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2021 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index a33c1a41dc..495113a637 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1302,12 +1302,10 @@ int find_free_slot(const item_def &i)
int move_item_to_player( int obj, int quant_got, bool quiet )
{
if (you.attribute[ATTR_CAUGHT] && mitm[obj].base_type == OBJ_MISSILES
- && mitm[obj].sub_type == MI_THROWING_NET)
+ && mitm[obj].sub_type == MI_THROWING_NET && item_is_stationary(mitm[obj]))
{
- quant_got--;
mpr("You cannot pick up the net that traps you!");
- if (!quant_got)
- return (1);
+ return (1);
}
int retval = quant_got;