diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-29 06:52:14 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-29 06:52:14 +0000 |
commit | 2c0a2b2364fbb07b596aba9c0b8e46dc524c27b3 (patch) | |
tree | 28aab9ed116d6dd80dac9611c6094197674970d0 | |
parent | 5cc1ceda72618d37faa0113353e356fa78ce908f (diff) | |
download | crawl-ref-2c0a2b2364fbb07b596aba9c0b8e46dc524c27b3.tar.gz crawl-ref-2c0a2b2364fbb07b596aba9c0b8e46dc524c27b3.zip |
[1817715] Fixed autopickup trying to pick up nets you're caught in.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2651 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/itemprop.cc | 11 | ||||
-rw-r--r-- | crawl-ref/source/items.cc | 7 |
2 files changed, 12 insertions, 6 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index f9f4857332..7163e965f0 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -479,17 +479,22 @@ void do_uncurse_item( item_def &item ) // void set_item_stationary( item_def &item ) { - item.plus2 = 1; + if (item.base_type == OBJ_MISSILES && item.sub_type == MI_THROWING_NET) + item.plus2 = 1; } void remove_item_stationary( item_def &item ) { - item.plus2 = 0; + if (item.base_type == OBJ_MISSILES && item.sub_type == MI_THROWING_NET) + item.plus2 = 0; } bool item_is_stationary( const item_def &item ) { - return (item.plus2); + return (you.attribute[ATTR_HELD] + && item.base_type == OBJ_MISSILES + && item.sub_type == MI_THROWING_NET + && item.plus2); } // diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index f0b055b05b..9ffc8dde3b 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1438,9 +1438,7 @@ static void got_item(item_def& item, int quant) // the player's inventory is full. int move_item_to_player( int obj, int quant_got, bool quiet ) { - if (you.attribute[ATTR_HELD] && mitm[obj].base_type == OBJ_MISSILES - && mitm[obj].sub_type == MI_THROWING_NET - && item_is_stationary(mitm[obj])) + if (item_is_stationary(mitm[obj])) { mpr("You cannot pick up the net that holds you!"); return (1); @@ -2928,6 +2926,9 @@ static bool is_forced_autopickup(const item_def &item, std::string &iname) bool item_needs_autopickup(const item_def &item) { + if (item_is_stationary(item)) + return (false); + if (strstr(item.inscription.c_str(), "=g") != 0) return (true); |