From 788d94118353082a107fd95f2cffb452bbf4deb9 Mon Sep 17 00:00:00 2001 From: mogami Date: Thu, 23 Oct 2003 16:23:34 +0000 Subject: [PATCH] =?utf8?q?Revision=201.107=20=E3=81=A7=20auto=5Fpickup=5Fi?= =?utf8?q?tems()=20=E5=86=85=E3=81=A7=E3=82=A8=E3=83=B3=E3=83=90=E3=82=B0?= =?utf8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE?= =?utf8?q?=E6=AD=A3=E3=80=82=E6=9C=AC=E6=9D=A5=E3=81=AE=E3=82=AB=E3=83=97?= =?utf8?q?=E3=82=BB=E3=83=AB=E5=8C=96=E3=81=AE=E5=A4=89=E6=9B=B4=E3=81=A8?= =?utf8?q?=E3=81=AF=E7=84=A1=E9=96=A2=E4=BF=82=E3=81=AA=E3=82=B3=E3=83=BC?= =?utf8?q?=E3=83=89=E6=95=B4=E7=90=86=E3=82=92=E3=81=97=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=82=A8=E3=83=B3=E3=83=90=E3=82=B0?= =?utf8?q?=E3=81=97=E3=81=A6=E3=81=84=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/autopick.c | 105 ++++++++++++++++++++++++++------------------------------- 1 file changed, 48 insertions(+), 57 deletions(-) diff --git a/src/autopick.c b/src/autopick.c index fc363ce0f..7cde2f5b2 100644 --- a/src/autopick.c +++ b/src/autopick.c @@ -1590,85 +1590,76 @@ void auto_pickup_items(cave_type *c_ptr) /* Acquire next object */ next_o_idx = o_ptr->next_o_idx; - /* Get the index of auto-picker list */ idx = is_autopick(o_ptr); - /* Nothing defined on auto-picker? */ - if (idx < 0) continue; - - /* Always do auto-inscription first */ + /* Item index for floor -1,-2,-3,... */ auto_inscribe_item(o_ptr, idx); - /* Do auto-destroy */ - if (autopick_list[idx].action & DO_AUTODESTROY) + if (idx >= 0 && + (autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK))) { - auto_destroy_item(o_ptr, idx); - continue; - } - - /* Disturb on auto-pick */ - disturb(0,0); + disturb(0,0); - /* Is there an inventory space? */ - if (!inven_carry_okay(o_ptr)) - { - char o_name[MAX_NLEN]; + if (!inven_carry_okay(o_ptr)) + { + char o_name[MAX_NLEN]; - /* Describe the object */ - object_desc(o_name, o_ptr, TRUE, 3); + /* Describe the object */ + object_desc(o_name, o_ptr, TRUE, 3); - /* Message */ + /* Message */ #ifdef JP - msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name); + msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name); #else - msg_format("You have no room for %s.", o_name); + msg_format("You have no room for %s.", o_name); #endif - /* - * Hack - No duplicate messages. - * remember that a message is given for the item here. - */ - o_ptr->marked |= OM_NOMSG; + /* Hack - remember that the item has given a message here. */ + o_ptr->marked |= OM_NOMSG; - continue; - } - - /* Ask if needed */ - if (autopick_list[idx].action & DO_QUERY_AUTOPICK) - { - char out_val[MAX_NLEN+20]; - char o_name[MAX_NLEN]; - - if (o_ptr->marked & OM_NO_QUERY) - { - /* Already answered as 'No' */ continue; } + else if (autopick_list[idx].action & DO_QUERY_AUTOPICK) + { + char out_val[MAX_NLEN+20]; + char o_name[MAX_NLEN]; + + if (o_ptr->marked & OM_NO_QUERY) + { + /* Already answered as 'No' */ + continue; + } - /* Describe the object */ - object_desc(o_name, o_ptr, TRUE, 3); + /* Describe the object */ + object_desc(o_name, o_ptr, TRUE, 3); #ifdef JP - sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name); + sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name); #else - sprintf(out_val, "Pick up %s? ", o_name); + sprintf(out_val, "Pick up %s? ", o_name); #endif - if (!get_check(out_val)) - { - /* - * Hack - No duplicate messages/questions. - * remember that a message is given - * for the item here. - */ - o_ptr->marked |= (OM_NOMSG | OM_NO_QUERY); - continue; - } + if (!get_check(out_val)) + { + /* Hack - remember that the item has given a message here. */ + o_ptr->marked |= (OM_NOMSG | OM_NO_QUERY); + continue; + } + } + py_pickup_aux(this_o_idx); } - - /* Pick it up! */ - py_pickup_aux(this_o_idx); - } + + /* + * Do auto-destroy; + * When always_pickup is 'yes', we disable + * auto-destroyer from autopick function, and do only + * easy-auto-destroyer. + */ + else + { + auto_destroy_item(o_ptr, idx); + } + } /* for () */ } -- 2.11.0