OSDN Git Service

例えば, 鑑定の杖 {@ud} で鑑定する作業中には d) のアイテムを鑑定できな
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 14 Aug 2003 11:14:59 +0000 (11:14 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 14 Aug 2003 11:14:59 +0000 (11:14 +0000)
くなっていた. 他にもこういった2回以上アイテムを選ぶ作業がある場合に,
2回目以降のアイテム選択が最初のcommand_cmdに関係する銘で影響されてい
たので, get_item()/get_item_floor()でアイテムを選択できてTRUEを返す場
合はcommand_cmd = 0とするように変更.

src/object1.c

index a4a0b6b..2548149 100644 (file)
@@ -5525,13 +5525,17 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
        /* Get the item index */
        if (repeat_pull(cp))
        {
-               if (*cp == INVEN_FORCE) { /* the_force */
-                   item_tester_tval = 0;
-                   item_tester_hook = NULL;
-                   return (TRUE);
-               } else
+               /* the_force */
+               if (*cp == INVEN_FORCE)
+               {
+                       item_tester_tval = 0;
+                       item_tester_hook = NULL;
+                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+                       return (TRUE);
+               }
+
                /* Floor item? */
-               if (*cp < 0)
+               else if (*cp < 0)
                {
                        object_type *o_ptr;
 
@@ -5550,6 +5554,8 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                                /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
 
+                               command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
                                /* Success */
                                return (TRUE);
                        }
@@ -5564,6 +5570,8 @@ bool get_item(int *cp, cptr pmt, cptr str, int mode)
                        /* Forget the item_tester_hook restriction */
                        item_tester_hook = NULL;
 
+                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
                        /* Success */
                        return (TRUE);
                }
@@ -6312,10 +6320,15 @@ if (ver && !verify("
        /* Warning if needed */
        if (oops && str) msg_print(str);
 
+       if (item)
+       {
 #ifdef ALLOW_REPEAT
-       if (item) repeat_push(*cp);
+               repeat_push(*cp);
 #endif /* ALLOW_REPEAT */
 
+               command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+       }
+
        /* Result */
        return (item);
 }
@@ -6544,13 +6557,17 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
        /* Get the item index */
        if (repeat_pull(cp))
        {
-               if (*cp == INVEN_FORCE) { /* the_force */
-                   item_tester_tval = 0;
-                   item_tester_hook = NULL;
-                   return (TRUE);
-               } else
+               /* the_force */
+               if (*cp == INVEN_FORCE)
+               {
+                       item_tester_tval = 0;
+                       item_tester_hook = NULL;
+                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+                       return (TRUE);
+               }
+
                /* Floor item? */
-               if (*cp < 0)
+               else if (*cp < 0)
                {
                        object_type *o_ptr;
 
@@ -6569,6 +6586,8 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                                /* Forget the item_tester_hook restriction */
                                item_tester_hook = NULL;
 
+                               command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
                                /* Success */
                                return (TRUE);
                        }
@@ -6583,6 +6602,8 @@ bool get_item_floor(int *cp, cptr pmt, cptr str, int mode)
                        /* Forget the item_tester_hook restriction */
                        item_tester_hook = NULL;
 
+                       command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+
                        /* Success */
                        return (TRUE);
                }
@@ -7737,10 +7758,15 @@ if (ver && !verify("
        /* Warning if needed */
        if (oops && str) msg_print(str);
 
+       if (item)
+       {
 #ifdef ALLOW_REPEAT
-       if (item) repeat_push(*cp);
+               repeat_push(*cp);
 #endif /* ALLOW_REPEAT */
 
+               command_cmd = 0; /* Hack -- command_cmd is no longer effective */
+       }
+
        /* Result */
        return (item);
 }