OSDN Git Service

make_object()の前にget_obj_num_hookが指定されていた場合は, AM_GOODが
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 9 Jun 2003 21:26:46 +0000 (21:26 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Mon, 9 Jun 2003 21:26:46 +0000 (21:26 +0000)
渡されたとしてもmake_object()内ではget_obj_num_prep()し直さないように
変更. その場合は, make_object()の前にget_obj_num_prep()でテーブルが構
成されていることを信用する.

src/object2.c

index 1294cb3..38be7a4 100644 (file)
@@ -4622,10 +4622,15 @@ bool make_object(object_type *j_ptr, u32b mode)
        {
                int k_idx;
 
+               /*
+                * Hack -- If restriction is already specified, allocation table is
+                * should be prepared by get_obj_num_prep().
+                * We rely previous preparation before reaching here.
+                */
                /* Good objects */
-               if (mode & AM_GOOD)
+               if ((mode & AM_GOOD) && !get_obj_num_hook)
                {
-                       /* Activate restriction */
+                       /* Activate restriction (if already specified, use it) */
                        get_obj_num_hook = kind_is_good;
 
                        /* Prepare allocation table */