OSDN Git Service

ザックが一杯で, ザックの中の2本以上のまとめられた鑑定の杖をザックの中
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 4 Aug 2004 11:04:20 +0000 (11:04 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 4 Aug 2004 11:04:20 +0000 (11:04 +0000)
のアイテムに対して使い, 鑑定したアイテムが自動破壊される場合, アイテ
ムが破壊される前に鑑定の杖を床に落としてしまっていたバグを修正. ザッ
クからアイテムがあふれる処理の前には自動破壊処理とザックをまとめる処
理を行うこととした.

src/dungeon.c

index 702ab8e..ab694c8 100644 (file)
@@ -5351,12 +5351,15 @@ static void pack_overflow(void)
 {
        if (inventory[INVEN_PACK].k_idx)
        {
-               int item = INVEN_PACK;
                char o_name[MAX_NLEN];
                object_type *o_ptr;
 
+               /* Is auto-destroy done? */
+               notice_stuff();
+               if (!inventory[INVEN_PACK].k_idx) return;
+
                /* Access the slot to be dropped */
-               o_ptr = &inventory[item];
+               o_ptr = &inventory[INVEN_PACK];
 
                /* Disturbing */
                disturb(0, 0);
@@ -5373,18 +5376,18 @@ static void pack_overflow(void)
 
                /* Message */
 #ifdef JP
-               msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
+               msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(INVEN_PACK));
 #else
-               msg_format("You drop %s (%c).", o_name, index_to_label(item));
+               msg_format("You drop %s (%c).", o_name, index_to_label(INVEN_PACK));
 #endif
 
                /* Drop it (carefully) near the player */
                (void)drop_near(o_ptr, 0, py, px);
 
                /* Modify, Describe, Optimize */
-               inven_item_increase(item, -255);
-               inven_item_describe(item);
-               inven_item_optimize(item);
+               inven_item_increase(INVEN_PACK, -255);
+               inven_item_describe(INVEN_PACK);
+               inven_item_optimize(INVEN_PACK);
 
                /* Handle "p_ptr->notice" */
                notice_stuff();