From 86dd3a54bf5985566f112fe220482b8acc1e70af Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 29 Oct 2007 06:53:31 +0000 Subject: Trunk->0.3 merge (2651): Net autopickup fix. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2652 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/itemprop.cc | 11 ++++++++--- 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 12bd224998..ba5d23828c 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -458,17 +458,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 156e7e852d..7f93cb7796 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1318,9 +1318,7 @@ int find_free_slot(const item_def &i) // 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); @@ -2776,6 +2774,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); -- cgit v1.2.3-54-g00ecf