OSDN Git Service

自動破壊を簡単に設定する機能を破壊コマンド(k/^D)に追加した。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 24 Sep 2003 22:12:34 +0000 (22:12 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 24 Sep 2003 22:12:34 +0000 (22:12 +0000)
「壊しますか? [y/n/Auto]」で、'a'を押すとそのキャラクターが
死ぬまでの期間だけ有効な自動破壊設定をpicktype.prfに書き加える。

src/autopick.c
src/cmd3.c
src/defines.h
src/externs.h
src/files.c
src/load.c
src/save.c
src/types.h
src/variable.c

index 051f26d..b527f89 100644 (file)
@@ -424,6 +424,238 @@ static bool autopick_new_entry(autopick_type *entry, cptr str, bool allow_defaul
 
 
 /*
+ * Favorite weapons
+ */
+static bool is_favorite(object_type *o_ptr, bool others_ok)
+{
+       /* Only weapons match */
+       switch(o_ptr->tval)
+       {
+       case TV_BOW: case TV_HAFTED: case TV_POLEARM:
+       case TV_SWORD: case TV_DIGGING:
+               break;
+       default: return FALSE;
+       }
+
+       /* Favorite weapons are varied depend on the class */
+       switch (p_ptr->pclass)
+       {
+       case CLASS_PRIEST:
+       {
+               u32b flgs[TR_FLAG_SIZE];
+               object_flags_known(o_ptr, flgs);
+
+               if (!have_flag(flgs, TR_BLESSED) && 
+                   !(o_ptr->tval == TV_HAFTED))
+                       return FALSE;
+               break;
+       }
+
+       case CLASS_MONK:
+       case CLASS_FORCETRAINER:
+               /* Icky to wield? */
+               if (!(s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval]))
+                       return FALSE;
+               break;
+
+       case CLASS_BEASTMASTER:
+       case CLASS_CAVALRY:
+       {
+               u32b flgs[TR_FLAG_SIZE];
+               object_flags_known(o_ptr, flgs);
+
+               /* Is it known to be suitable to using while riding? */
+               if (!(have_flag(flgs, TR_RIDING)))
+                       return FALSE;
+
+               break;
+       }
+
+       case CLASS_NINJA:
+               /* Icky to wield? */
+               if (s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
+                       return FALSE;
+               break;
+
+       default:
+               /* Non-special class */
+               if (others_ok) return TRUE;
+               else return FALSE;
+       }
+
+       return TRUE;
+}
+
+
+/*
+ * Get auto-picker entry from o_ptr.
+ */
+static void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
+{
+       /* Assume that object name is to be added */
+       bool name = TRUE;
+
+       entry->name = NULL;
+       entry->insc = string_make(quark_str(o_ptr->inscription));
+       entry->action = DO_AUTOPICK | DO_DISPLAY;
+       entry->flag[0] = entry->flag[1] = 0L;
+       entry->dice = 0;
+
+       if (!object_aware_p(o_ptr))
+       {
+               ADD_FLG(FLG_UNAWARE);
+       }
+       else if (!object_known_p(o_ptr))
+       {
+               ADD_FLG(FLG_UNIDENTIFIED);
+       }
+       else
+       {
+               if (o_ptr->name2)
+               {
+                       ego_item_type *e_ptr = &e_info[o_ptr->name2];
+                       entry->name = string_make(e_name + e_ptr->name);
+                       name = FALSE;
+                       ADD_FLG(FLG_EGO);
+               }
+               else if (o_ptr->name1 || o_ptr->art_name)
+                       ADD_FLG(FLG_ARTIFACT);
+               else
+               {
+                       /* Wearable nameless object */
+                       switch (o_ptr->tval)
+                       {
+                       case TV_WHISTLE:
+                       case TV_SHOT: case TV_ARROW: case TV_BOLT: case TV_BOW:
+                       case TV_DIGGING: case TV_HAFTED: case TV_POLEARM: case TV_SWORD: 
+                       case TV_BOOTS: case TV_GLOVES: case TV_HELM: case TV_CROWN:
+                       case TV_SHIELD: case TV_CLOAK:
+                       case TV_SOFT_ARMOR: case TV_HARD_ARMOR: case TV_DRAG_ARMOR:
+                       case TV_LITE: case TV_AMULET: case TV_RING: case TV_CARD:
+
+                               ADD_FLG(FLG_NAMELESS);
+                               break;
+                       }
+               }
+
+       }
+
+
+       switch(o_ptr->tval)
+       {
+               object_kind *k_ptr; 
+       case TV_HAFTED: case TV_POLEARM: case TV_SWORD: case TV_DIGGING:
+               k_ptr = &k_info[o_ptr->k_idx];
+               if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
+                       ADD_FLG(FLG_BOOSTED);
+       }
+
+       if (o_ptr->tval == TV_CORPSE && object_is_shoukinkubi(o_ptr))
+       {
+               REM_FLG(FLG_WORTHLESS);
+               ADD_FLG(FLG_WANTED);
+       }
+
+       if ((o_ptr->tval == TV_CORPSE || o_ptr->tval == TV_STATUE)
+           && (r_info[o_ptr->pval].flags1 & RF1_UNIQUE))
+       {
+               ADD_FLG(FLG_UNIQUE);
+       }
+
+       if (o_ptr->tval == TV_CORPSE && strchr("pht", r_info[o_ptr->pval].d_char))
+       {
+               ADD_FLG(FLG_HUMAN);
+       }
+
+       if (o_ptr->tval >= TV_LIFE_BOOK &&
+           !check_book_realm(o_ptr->tval, o_ptr->sval))
+       {
+               ADD_FLG(FLG_UNREADABLE);
+               if (o_ptr->tval != TV_ARCANE_BOOK) name = FALSE;
+       }
+
+       if (REALM1_BOOK == o_ptr->tval &&
+           p_ptr->pclass != CLASS_SORCERER &&
+           p_ptr->pclass != CLASS_RED_MAGE)
+       {
+               ADD_FLG(FLG_REALM1);
+               name = FALSE;
+       }
+
+       if (REALM2_BOOK == o_ptr->tval &&
+           p_ptr->pclass != CLASS_SORCERER &&
+           p_ptr->pclass != CLASS_RED_MAGE)
+       {
+               ADD_FLG(FLG_REALM2);
+               name = FALSE;
+       }
+
+       if (o_ptr->tval >= TV_LIFE_BOOK && 0 == o_ptr->sval)
+               ADD_FLG(FLG_FIRST);
+       if (o_ptr->tval >= TV_LIFE_BOOK && 1 == o_ptr->sval)
+               ADD_FLG(FLG_SECOND);
+       if (o_ptr->tval >= TV_LIFE_BOOK && 2 == o_ptr->sval)
+               ADD_FLG(FLG_THIRD);
+       if (o_ptr->tval >= TV_LIFE_BOOK && 3 == o_ptr->sval)
+               ADD_FLG(FLG_FOURTH);
+
+       if (o_ptr->tval == TV_SHOT || o_ptr->tval == TV_BOLT
+                || o_ptr->tval == TV_ARROW)
+               ADD_FLG(FLG_MISSILES);
+       else if (o_ptr->tval == TV_SCROLL || o_ptr->tval == TV_STAFF
+                || o_ptr->tval == TV_WAND || o_ptr->tval == TV_ROD)
+               ADD_FLG(FLG_DEVICES);
+       else if (o_ptr->tval == TV_LITE)
+               ADD_FLG(FLG_LIGHTS);
+       else if (o_ptr->tval == TV_SKELETON || o_ptr->tval == TV_BOTTLE
+                || o_ptr->tval == TV_JUNK || o_ptr->tval == TV_STATUE)
+               ADD_FLG(FLG_JUNKS);
+       else if (o_ptr->tval >= TV_LIFE_BOOK)
+               ADD_FLG(FLG_SPELLBOOKS);
+       else if (is_favorite(o_ptr, FALSE))
+               ADD_FLG(FLG_FAVORITE);
+       else if (o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD
+                || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)
+               ADD_FLG(FLG_WEAPONS);
+       else if (o_ptr->tval == TV_SHIELD)
+               ADD_FLG(FLG_SHIELDS);
+       else if (o_ptr->tval == TV_BOW)
+               ADD_FLG(FLG_BOWS);
+       else if (o_ptr->tval == TV_RING)
+               ADD_FLG(FLG_RINGS);
+       else if (o_ptr->tval == TV_AMULET)
+               ADD_FLG(FLG_AMULETS);
+       else if (o_ptr->tval == TV_DRAG_ARMOR || o_ptr->tval == TV_HARD_ARMOR ||
+                o_ptr->tval == TV_SOFT_ARMOR)
+               ADD_FLG(FLG_SUITS);
+       else if (o_ptr->tval == TV_CLOAK)
+               ADD_FLG(FLG_CLOAKS);
+       else if (o_ptr->tval == TV_HELM)
+               ADD_FLG(FLG_HELMS);
+       else if (o_ptr->tval == TV_GLOVES)
+               ADD_FLG(FLG_GLOVES);
+       else if (o_ptr->tval == TV_BOOTS)
+               ADD_FLG(FLG_BOOTS);
+
+
+       if (name)
+       {
+               char o_name[MAX_NLEN];
+               object_desc(o_name, o_ptr, FALSE, 0);
+
+               entry->name = string_make(o_name);
+       }
+
+       else if (!entry->name)
+       {
+               entry->name = string_make("");
+       }
+
+       return;
+}
+
+
+/*
  * A function to delete entry
  */
 static void autopick_free_entry(autopick_type *entry)
@@ -436,12 +668,21 @@ static void autopick_free_entry(autopick_type *entry)
 /*
  * Initialize auto-picker preference
  */
+#define MAX_AUTOPICK_DEFAULT 200
+
 void init_autopicker(void)
 {
        static const char easy_autopick_inscription[] = "(:=g";
        autopick_type entry;
        int i;
 
+       if (!autopick_list)
+       {
+               max_max_autopick = MAX_AUTOPICK_DEFAULT;
+               C_MAKE(autopick_list, max_max_autopick, autopick_type);
+               max_autopick = 0;
+       }
+
        /* Clear old entries */
        for( i = 0; i < max_autopick; i++)
                autopick_free_entry(&autopick_list[i]);
@@ -454,18 +695,45 @@ void init_autopicker(void)
 }
 
 
+/*
+ * Add one line to autopick_list[]
+ */
+static void add_autopick_list(autopick_type *entry)
+{
+       /* There is no enough space to add one line */
+       if (max_autopick >= max_max_autopick)
+       {
+               int old_max_max_autopick = max_max_autopick;
+               autopick_type *old_autopick_list = autopick_list;
+
+               /* Increase size of list */
+               max_max_autopick += MAX_AUTOPICK_DEFAULT;
+
+               /* Allocate */
+               C_MAKE(autopick_list, max_max_autopick, autopick_type);
+
+               /* Copy from old list to new list */
+               C_COPY(autopick_list, old_autopick_list, old_max_max_autopick, autopick_type);
+
+               /* Kill old list */
+               C_FREE(old_autopick_list, old_max_max_autopick, autopick_type);
+       }
+
+       /* Add one line */
+       autopick_list[max_autopick] = *entry;
+
+       max_autopick++;
+}
+
 
 /*
  *  Process line for auto picker/destroyer.
  */
 errr process_pickpref_file_line(char *buf)
 {
-       autopick_type entry;
+       autopick_type an_entry, *entry = &an_entry;
        int i;
 
-       if (max_autopick == MAX_AUTOPICK)
-               return 1;
-       
        /* Nuke illegal char */
        for(i = 0; buf[i]; i++)
        {
@@ -481,17 +749,17 @@ errr process_pickpref_file_line(char *buf)
        }
        buf[i] = 0;
        
-       if (!autopick_new_entry(&entry, buf, FALSE)) return 0;
+       if (!autopick_new_entry(entry, buf, FALSE)) return 0;
 
        /* Already has the same entry? */ 
        for(i = 0; i < max_autopick; i++)
-               if(!strcmp(entry.name, autopick_list[i].name)
-                  && entry.flag[0] == autopick_list[i].flag[0]
-                  && entry.flag[1] == autopick_list[i].flag[1]
-                  && entry.dice == autopick_list[i].dice
-                  && entry.bonus == autopick_list[i].bonus) return 0;
+               if(!strcmp(entry->name, autopick_list[i].name)
+                  && entry->flag[0] == autopick_list[i].flag[0]
+                  && entry->flag[1] == autopick_list[i].flag[1]
+                  && entry->dice == autopick_list[i].dice
+                  && entry->bonus == autopick_list[i].bonus) return 0;
 
-       autopick_list[max_autopick++] = entry;
+       add_autopick_list(entry);
        return 0;
 }
 
@@ -630,69 +898,6 @@ static cptr autopick_line_from_entry_kill(autopick_type *entry)
 
 
 /*
- * Favorite weapons
- */
-static bool is_favorite(object_type *o_ptr, bool others_ok)
-{
-       /* Only weapons match */
-       switch(o_ptr->tval)
-       {
-       case TV_BOW: case TV_HAFTED: case TV_POLEARM:
-       case TV_SWORD: case TV_DIGGING:
-               break;
-       default: return FALSE;
-       }
-
-       /* Favorite weapons are varied depend on the class */
-       switch (p_ptr->pclass)
-       {
-       case CLASS_PRIEST:
-       {
-               u32b flgs[TR_FLAG_SIZE];
-               object_flags_known(o_ptr, flgs);
-
-               if (!have_flag(flgs, TR_BLESSED) && 
-                   !(o_ptr->tval == TV_HAFTED))
-                       return FALSE;
-               break;
-       }
-
-       case CLASS_MONK:
-       case CLASS_FORCETRAINER:
-               /* Icky to wield? */
-               if (!(s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval]))
-                       return FALSE;
-               break;
-
-       case CLASS_BEASTMASTER:
-       case CLASS_CAVALRY:
-       {
-               u32b flgs[TR_FLAG_SIZE];
-               object_flags_known(o_ptr, flgs);
-
-               /* Is it known to be suitable to using while riding? */
-               if (!(have_flag(flgs, TR_RIDING)))
-                       return FALSE;
-
-               break;
-       }
-
-       case CLASS_NINJA:
-               /* Icky to wield? */
-               if (s_info[p_ptr->pclass].w_max[o_ptr->tval-TV_BOW][o_ptr->sval] <= WEAPON_EXP_BEGINNER)
-                       return FALSE;
-               break;
-
-       default:
-               /* Non-special class */
-               if (others_ok) return TRUE;
-               else return FALSE;
-       }
-
-       return TRUE;
-}
-
-/*
  * A function for Auto-picker/destroyer
  * Examine whether the object matches to the entry
  */
@@ -1288,104 +1493,394 @@ void delayed_auto_destroy(void)
        item = cave[py][px].o_idx;
        while (item)
        {
-               int next = o_list[item].next_o_idx;
-               delayed_auto_destroy_aux(-item);
-               item = next;
+               int next = o_list[item].next_o_idx;
+               delayed_auto_destroy_aux(-item);
+               item = next;
+       }
+}
+
+
+/*
+ * Automatically pickup/destroy items in this grid.
+ */
+void auto_pickup_items(cave_type *c_ptr)
+{
+       s16b this_o_idx, next_o_idx = 0;
+       
+       /* Scan the pile of objects */
+       for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+       {
+               int idx;
+       
+               /* Acquire object */
+               object_type *o_ptr = &o_list[this_o_idx];
+               
+               /* Acquire next object */
+               next_o_idx = o_ptr->next_o_idx;
+
+               idx = is_autopick(o_ptr);
+
+               /* Item index for floor -1,-2,-3,...  */
+               auto_inscribe_item((-this_o_idx), idx);
+
+               if (idx >= 0 &&
+                       (autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)))
+               {
+                       disturb(0,0);
+
+                       if (!inven_carry_okay(o_ptr))
+                       {
+                               char o_name[MAX_NLEN];
+
+                               /* Describe the object */
+                               object_desc(o_name, o_ptr, TRUE, 3);
+
+                               /* Message */
+#ifdef JP
+                               msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
+#else
+                               msg_format("You have no room for %s.", o_name);
+#endif
+                               /* Hack - remember that the item has given a message here. */
+                               o_ptr->marked |= OM_NOMSG;
+
+                               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);
+
+#ifdef JP
+                               sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
+#else
+                               sprintf(out_val, "Pick up %s? ", o_name);
+#endif
+
+                               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);
+
+                       continue;
+               }
+               
+               /*
+                * Do auto-destroy;
+                * When always_pickup is 'yes', we disable
+                * auto-destroyer from autopick function, and do only
+                * easy-auto-destroyer.
+                */
+               else
+               {
+                       if (auto_destroy_item((-this_o_idx), idx))
+                               continue;
+               }
+       }
+}
+
+
+#define PT_DEFAULT 0
+#define PT_WITH_PNAME 1
+
+/*
+ *  Get file name for autopick preference
+ */
+static cptr pickpref_filename(int filename_mode)
+{
+#ifdef JP
+       static const char namebase[] = "picktype";
+#else
+       static const char namebase[] = "pickpref";
+#endif
+
+       switch (filename_mode)
+       {
+       case PT_DEFAULT:
+               return format("%s.prf", namebase);
+
+       case PT_WITH_PNAME:
+               return format("%s-%s.prf", namebase, player_name);
+
+       default:
+               return NULL;
+       }
+}
+
+
+static const char autoregister_header[] = "?:$AUTOREGISTER";
+
+/*
+ *  Clear auto registered lines in the picktype.prf .
+ */
+static bool clear_auto_register(void)
+{
+       char tmp_file[1024];
+       char pref_file[1024];
+       char buf[1024];
+       FILE *pref_fff;
+       FILE *tmp_fff;
+       int num = 0;
+       bool autoregister = FALSE;
+       bool okay = TRUE;
+
+       path_build(pref_file, sizeof(pref_file), ANGBAND_DIR_USER, pickpref_filename(PT_WITH_PNAME));
+       pref_fff = my_fopen(pref_file, "r");
+
+       if (!pref_fff)
+       {
+               path_build(pref_file, sizeof(pref_file), ANGBAND_DIR_USER, pickpref_filename(PT_DEFAULT));
+               pref_fff = my_fopen(pref_file, "r");
+       }
+
+       if (!pref_fff)
+       {
+               /* No file yet */
+               return TRUE;
+       }
+
+       /* Open a new (temporary) file */
+       tmp_fff = my_fopen_temp(tmp_file, sizeof(tmp_file));
+
+       if (!tmp_fff)
+       {
+               /* Close the preference file */
+               fclose(pref_fff);
+
+#ifdef JP
+               msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£", tmp_file);
+#else
+               msg_format("Failed to create temporary file %s.", tmp_file);
+#endif
+               msg_print(NULL);
+               return FALSE;
+       }
+
+       
+       /* Loop for every line */
+       while (TRUE)
+       {
+               /* Read a line */
+               if (my_fgets(pref_fff, buf, sizeof(buf))) break;
+
+               if (autoregister)
+               {
+                       /* Delete auto-registered line */
+
+                       /* Count auto-destroy preference lines */
+                       if (buf[0] != '#' && buf[0] != '?') num++;
+               }
+
+               /* We are looking for auto-registered line */
+               else
+               {
+                       if (streq(buf, autoregister_header))
+                       {
+                               /* Delete all further lines */
+                               autoregister = TRUE;
+                       }
+                       else
+                       {
+                               /* Copy orginally lines */
+                               fprintf(tmp_fff, "%s\n", buf);
+                       }
+               }
+       }
+
+       /* Close files */
+       my_fclose(pref_fff);
+       my_fclose(tmp_fff);
+
+       if (num)
+       {
+#ifdef JP
+               msg_format("°ÊÁ°¤Î¥­¥ã¥é¥¯¥¿¡¼ÍѤμ«Æ°ÀßÄê(%d¹Ô)¤¬»Ä¤Ã¤Æ¤¤¤Þ¤¹¡£", num);
+               strcpy(buf, "¸Å¤¤ÀßÄê¹Ô¤Ïºï½ü¤·¤Þ¤¹¡£¤è¤í¤·¤¤¤Ç¤¹¤«¡©");
+#else
+               msg_format("Auto registered lines (%d lines) for previous character are remaining.", num);
+               strcpy(buf, "These lines will be deleted.  Are you sure? ");
+#endif
+
+               /* You can cancel it */
+               if (!get_check(buf))
+               {
+                       okay = FALSE;
+                       autoregister = FALSE;
+
+#ifdef JP
+                       msg_print("¥¨¥Ç¥£¥¿¤Î¥«¥Ã¥È&¥Ú¡¼¥¹¥ÈÅù¤ò»È¤Ã¤ÆɬÍפʹԤòÈòÆñ¤·¤Æ¤¯¤À¤µ¤¤¡£");
+#else
+                       msg_print("Use cut & paste of auto picker editor (_) to keep old prefs.");
+#endif
+               }
+       }
+
+
+       /* If there are some changes, overwrite the original file with new one */
+       if (autoregister)
+       {
+               /* Copy contents of temporary file */
+
+               tmp_fff = my_fopen(tmp_file, "r");
+               pref_fff = my_fopen(pref_file, "w");
+
+               while (!my_fgets(tmp_fff, buf, sizeof(buf)))
+                       fprintf(pref_fff, "%s\n", buf);
+
+               my_fclose(pref_fff);
+               my_fclose(tmp_fff);
+       }
+
+       /* Kill the temporary file */
+       fd_kill(tmp_file);
+
+       return okay;
+}
+
+
+/*
+ *  Automatically register an auto-destroy preference line
+ */
+bool add_auto_register(object_type *o_ptr)
+{
+       char buf[1024];
+       char pref_file[1024];
+       FILE *pref_fff;
+       autopick_type an_entry, *entry = &an_entry;
+
+       int match_autopick = is_autopick(o_ptr);
+
+       /* Already registered */
+       if (match_autopick != -1)
+       {
+               cptr what;
+               byte act = autopick_list[match_autopick].action;
+
+#ifdef JP
+               if (act & DO_AUTOPICK) what = "¼«Æ°¤Ç½¦¤¦";
+               else if (act & DO_AUTODESTROY) what = "¼«Æ°Ç˲õ¤¹¤ë";
+               else if (act & DONT_AUTOPICK) what = "ÊüÃÖ¤¹¤ë";
+               else /* if (act & DO_QUERY_AUTOPICK) */ what = "³Îǧ¤·¤Æ½¦¤¦";
+
+               msg_format("¤½¤Î¥¢¥¤¥Æ¥à¤Ï´û¤Ë%s¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£", what);
+#else
+               if (act & DO_AUTOPICK) what = "auto-pickup";
+               else if (act & DO_AUTODESTROY) what = "auto-destroy";
+               else if (act & DONT_AUTOPICK) what = "leave on floor";
+               else /* if (act & DO_QUERY_AUTOPICK) */ what = "query auto-pickup";
+
+               msg_format("The object is already registered to %s.", what);
+#endif
+               
+               return FALSE;
+       }
+
+
+       if (!p_ptr->autopick_autoregister)
+       {
+               /* Clear old auto registered lines */
+               if (!clear_auto_register()) return FALSE;
        }
-}
 
+       /* Try a filename with player name */
+       path_build(pref_file, sizeof(pref_file), ANGBAND_DIR_USER, pickpref_filename(PT_WITH_PNAME));
+       pref_fff = my_fopen(pref_file, "r");
 
-/*
- * Automatically pickup/destroy items in this grid.
- */
-void auto_pickup_items(cave_type *c_ptr)
-{
-       s16b this_o_idx, next_o_idx = 0;
-       
-       /* Scan the pile of objects */
-       for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+       if (!pref_fff)
        {
-               int idx;
-       
-               /* Acquire object */
-               object_type *o_ptr = &o_list[this_o_idx];
-               
-               /* Acquire next object */
-               next_o_idx = o_ptr->next_o_idx;
+               /* Use default name */
+               path_build(pref_file, sizeof(pref_file), ANGBAND_DIR_USER, pickpref_filename(PT_DEFAULT));
+               pref_fff = my_fopen(pref_file, "r");
+       }
 
-               idx = is_autopick(o_ptr);
+       /* Check the header */
+       while (TRUE)
+       {
+               /* Read a line */
+               if (my_fgets(pref_fff, buf, sizeof(buf)))
+               {
+                       /* No header found */
+                       p_ptr->autopick_autoregister = FALSE;
 
-               /* Item index for floor -1,-2,-3,...  */
-               auto_inscribe_item((-this_o_idx), idx);
+                       break;
+               }
 
-               if (idx >= 0 &&
-                       (autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)))
+               if (streq(buf, autoregister_header))
                {
-                       disturb(0,0);
+                       /* Found the header */
+                       p_ptr->autopick_autoregister = TRUE;
 
-                       if (!inven_carry_okay(o_ptr))
-                       {
-                               char o_name[MAX_NLEN];
+                       break;
+               }
+       }
 
-                               /* Describe the object */
-                               object_desc(o_name, o_ptr, TRUE, 3);
+       /* Close read only FILE* */
+       fclose(pref_fff);
 
-                               /* Message */
+       /* Open for append */
+       pref_fff = my_fopen(pref_file, "a");
+
+       /* Failure */
+       if (!pref_fff) {
 #ifdef JP
-                               msg_format("¥¶¥Ã¥¯¤Ë¤Ï%s¤òÆþ¤ì¤ë·ä´Ö¤¬¤Ê¤¤¡£", o_name);
+               msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£", pref_file);
 #else
-                               msg_format("You have no room for %s.", o_name);
+               msg_format("Failed to open %s.", pref_file);
 #endif
-                               /* Hack - remember that the item has given a message here. */
-                               o_ptr->marked |= OM_NOMSG;
-
-                               continue;
-                       }
-                       else if (autopick_list[idx].action & DO_QUERY_AUTOPICK)
-                       {
-                               char out_val[MAX_NLEN+20];
-                               char o_name[MAX_NLEN];
+               msg_print(NULL);
 
-                               if (o_ptr->marked & OM_NO_QUERY)
-                               {
-                                       /* Already answered as 'No' */
-                                       continue;
-                               }
+               /* Failed */
+               return FALSE;
+       }
 
-                               /* Describe the object */
-                               object_desc(o_name, o_ptr, TRUE, 3);
+       if (!p_ptr->autopick_autoregister)
+       {
+               /* Add the header */
+               fprintf(pref_fff, "%s\n", autoregister_header);
 
 #ifdef JP
-                               sprintf(out_val, "%s¤ò½¦¤¤¤Þ¤¹¤«? ", o_name);
+               fprintf(pref_fff, "%s\n", "# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°ÅÐÏ¿¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£");
+               fprintf(pref_fff, "%s\n", "# ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢É¬ÍפʹԤϾå¤ÎÊý¤Ø°ÜÆ°¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£");
 #else
-                               sprintf(out_val, "Pick up %s? ", o_name);
+               fprintf(pref_fff, "%s\n", "# *Waring!* The lines below will be deleated later.");
+               fprintf(pref_fff, "%s\n", "# Keep it by cut & paste if you need these lines for future characters.");
 #endif
 
-                               if (!get_check(out_val))
-                               {
-                                       /* Hack - remember that the item has given a message here. */
-                                       o_ptr->marked |= (OM_NOMSG | OM_NO_QUERY);
-                                       continue;
-                               }
+               /* Now auto register is in-use */
+               p_ptr->autopick_autoregister = TRUE;
+       }
 
-                       }
-                       py_pickup_aux(this_o_idx);
+       /* Get a preference entry */
+       autopick_entry_from_object(entry, o_ptr);
 
-                       continue;
-               }
-               
-               /*
-                * Do auto-destroy;
-                * When always_pickup is 'yes', we disable
-                * auto-destroyer from autopick function, and do only
-                * easy-auto-destroyer.
-                */
-               else
-               {
-                       if (auto_destroy_item((-this_o_idx), idx))
-                               continue;
-               }
-       }
+       /* Set to auto-destroy (with no-display) */
+       entry->action = DO_AUTODESTROY;
+
+       /* Load the new line as preference */
+       add_autopick_list(entry);
+
+       /* Add a line to the file */
+       /* Don't kill "entry" */
+       fprintf(pref_fff, "%s\n", autopick_line_from_entry(entry));
+
+       /* Close the file */
+       fclose(pref_fff);
+
+       return TRUE;
 }
 
 
@@ -1397,8 +1892,9 @@ void auto_pickup_items(cave_type *c_ptr)
 #define MARK_MARK     0x01
 #define MARK_BY_SHIFT 0x02
 
-#define LSTAT_BYPASS      0x01
-#define LSTAT_EXPRESSION  0x02
+#define LSTAT_BYPASS        0x01
+#define LSTAT_EXPRESSION    0x02
+#define LSTAT_AUTOREGISTER  0x04
 
 #define QUIT_WITHOUT_SAVE 1
 #define QUIT_AND_SAVE     2
@@ -2079,39 +2575,26 @@ static cptr *read_text_lines(cptr filename, bool user)
 }
 
 
-#define PT_DEFAULT 0
-#define PT_WITH_PNAME 1
-
 static cptr *read_pickpref_text_lines(int *filename_mode_p)
 {
        char buf[1024];
        cptr *lines_list;
 
-#ifdef JP
-       sprintf(buf, "picktype-%s.prf", player_name);
-#else
-       sprintf(buf, "pickpref-%s.prf", player_name);
-#endif
+       *filename_mode_p = PT_WITH_PNAME;
+       strcpy(buf, pickpref_filename(*filename_mode_p));
        lines_list = read_text_lines(buf, TRUE);
 
        if (!lines_list)
        {
-#ifdef JP
-               lines_list = read_text_lines("picktype.prf", TRUE);
-#else
-               lines_list = read_text_lines("pickpref.prf", TRUE);
-#endif
                *filename_mode_p = PT_DEFAULT;
+               strcpy(buf, pickpref_filename(*filename_mode_p));
+               lines_list = read_text_lines(buf, TRUE);
        }
 
        if (!lines_list)
        {
-#ifdef JP
-               lines_list = read_text_lines("picktype.prf", FALSE);
-#else
-               lines_list = read_text_lines("pickpref.prf", FALSE);
-#endif
-               *filename_mode_p = PT_WITH_PNAME;
+               strcpy(buf, pickpref_filename(*filename_mode_p));
+               lines_list = read_text_lines(buf, FALSE);
        }
 
        if (!lines_list)
@@ -2119,7 +2602,6 @@ static cptr *read_pickpref_text_lines(int *filename_mode_p)
                /* Allocate list of pointers */
                C_MAKE(lines_list, MAX_LINES, cptr);
                lines_list[0] = string_make("");
-               *filename_mode_p = PT_WITH_PNAME;
        }
        return lines_list;
 }
@@ -2492,126 +2974,6 @@ static bool insert_return_code(text_body_type *tb)
 
 
 /*
- * Get auto-picker entry from o_ptr.
- */
-void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr)
-{
-       char o_name[MAX_NLEN];
-       object_desc(o_name, o_ptr, FALSE, 0);
-
-       entry->name = string_make(o_name);
-       entry->insc = string_make(quark_str(o_ptr->inscription));
-       entry->action = DO_AUTOPICK | DO_DISPLAY;
-       entry->flag[0] = entry->flag[1] = 0L;
-       entry->dice = 0;
-
-       if (!object_aware_p(o_ptr))
-               ADD_FLG(FLG_UNAWARE);
-       if (object_value(o_ptr) <= 0)
-               ADD_FLG(FLG_WORTHLESS);
-
-       if (object_known_p(o_ptr))
-       {
-               if (o_ptr->name2)
-                       ADD_FLG(FLG_EGO);
-               else if (o_ptr->name1 || o_ptr->art_name)
-                       ADD_FLG(FLG_ARTIFACT);
-       }
-
-       switch(o_ptr->tval)
-       {
-               object_kind *k_ptr; 
-       case TV_HAFTED: case TV_POLEARM: case TV_SWORD: case TV_DIGGING:
-               k_ptr = &k_info[o_ptr->k_idx];
-               if ((o_ptr->dd != k_ptr->dd) || (o_ptr->ds != k_ptr->ds))
-                       ADD_FLG(FLG_BOOSTED);
-       }
-
-       if (o_ptr->tval == TV_CORPSE && object_is_shoukinkubi(o_ptr))
-       {
-               REM_FLG(FLG_WORTHLESS);
-               ADD_FLG(FLG_WANTED);
-       }
-
-       if ((o_ptr->tval == TV_CORPSE || o_ptr->tval == TV_STATUE)
-           && (r_info[o_ptr->pval].flags1 & RF1_UNIQUE))
-       {
-               REM_FLG(FLG_WORTHLESS);
-               ADD_FLG(FLG_UNIQUE);
-       }
-
-       if (o_ptr->tval == TV_CORPSE && strchr("pht", r_info[o_ptr->pval].d_char))
-       {
-               REM_FLG(FLG_WORTHLESS);
-               ADD_FLG(FLG_HUMAN);
-       }
-
-       if (o_ptr->tval >= TV_LIFE_BOOK &&
-           !check_book_realm(o_ptr->tval, o_ptr->sval))
-               ADD_FLG(FLG_UNREADABLE);
-
-       if (REALM1_BOOK == o_ptr->tval &&
-           p_ptr->pclass != CLASS_SORCERER &&
-           p_ptr->pclass != CLASS_RED_MAGE)
-               ADD_FLG(FLG_REALM1);
-
-       if (REALM2_BOOK == o_ptr->tval &&
-           p_ptr->pclass != CLASS_SORCERER &&
-           p_ptr->pclass != CLASS_RED_MAGE)
-               ADD_FLG(FLG_REALM2);
-
-       if (o_ptr->tval >= TV_LIFE_BOOK && 0 == o_ptr->sval)
-               ADD_FLG(FLG_FIRST);
-       if (o_ptr->tval >= TV_LIFE_BOOK && 1 == o_ptr->sval)
-               ADD_FLG(FLG_SECOND);
-       if (o_ptr->tval >= TV_LIFE_BOOK && 2 == o_ptr->sval)
-               ADD_FLG(FLG_THIRD);
-       if (o_ptr->tval >= TV_LIFE_BOOK && 3 == o_ptr->sval)
-               ADD_FLG(FLG_FOURTH);
-
-       if (o_ptr->tval == TV_SHOT || o_ptr->tval == TV_BOLT
-                || o_ptr->tval == TV_ARROW)
-               ADD_FLG(FLG_MISSILES);
-       else if (o_ptr->tval == TV_SCROLL || o_ptr->tval == TV_STAFF
-                || o_ptr->tval == TV_WAND || o_ptr->tval == TV_ROD)
-               ADD_FLG(FLG_DEVICES);
-       else if (o_ptr->tval == TV_LITE)
-               ADD_FLG(FLG_LIGHTS);
-       else if (o_ptr->tval == TV_SKELETON || o_ptr->tval == TV_BOTTLE
-                || o_ptr->tval == TV_JUNK || o_ptr->tval == TV_STATUE)
-               ADD_FLG(FLG_JUNKS);
-       else if (o_ptr->tval >= TV_LIFE_BOOK)
-               ADD_FLG(FLG_SPELLBOOKS);
-       else if (is_favorite(o_ptr, FALSE))
-               ADD_FLG(FLG_FAVORITE);
-       else if (o_ptr->tval == TV_POLEARM || o_ptr->tval == TV_SWORD
-                || o_ptr->tval == TV_DIGGING || o_ptr->tval == TV_HAFTED)
-               ADD_FLG(FLG_WEAPONS);
-       else if (o_ptr->tval == TV_SHIELD)
-               ADD_FLG(FLG_SHIELDS);
-       else if (o_ptr->tval == TV_BOW)
-               ADD_FLG(FLG_BOWS);
-       else if (o_ptr->tval == TV_RING)
-               ADD_FLG(FLG_RINGS);
-       else if (o_ptr->tval == TV_AMULET)
-               ADD_FLG(FLG_AMULETS);
-       else if (o_ptr->tval == TV_DRAG_ARMOR || o_ptr->tval == TV_HARD_ARMOR ||
-                o_ptr->tval == TV_SOFT_ARMOR)
-               ADD_FLG(FLG_SUITS);
-       else if (o_ptr->tval == TV_CLOAK)
-               ADD_FLG(FLG_CLOAKS);
-       else if (o_ptr->tval == TV_HELM)
-               ADD_FLG(FLG_HELMS);
-       else if (o_ptr->tval == TV_GLOVES)
-               ADD_FLG(FLG_GLOVES);
-       else if (o_ptr->tval == TV_BOOTS)
-               ADD_FLG(FLG_BOOTS);
-
-       return;
-}
-
-
-/*
  * Choose an item and get auto-picker entry from it.
  */
 static object_type *choose_object(cptr q, cptr s)
@@ -3194,7 +3556,7 @@ command_menu_type menu_data[] =
        {MN_SEARCH_STR, 1, KTRL('s'), EC_SEARCH_STR},
        {MN_SEARCH_FORW, 1, -1, EC_SEARCH_FORW},
        {MN_SEARCH_BACK, 1, KTRL('r'), EC_SEARCH_BACK},
-       {MN_SEARCH_OBJ, 1, -1, EC_SEARCH_OBJ},
+       {MN_SEARCH_OBJ, 1, KTRL('t'), EC_SEARCH_OBJ},
        {MN_SEARCH_DESTROYED, 1, -1, EC_SEARCH_DESTROYED},
 
        {MN_MOVE, 0, -1, -1},
@@ -3589,11 +3951,16 @@ static void draw_text_editor(text_body_type *tb)
                        if (*s++ != '?') continue;
                        if (*s++ != ':') continue;
 
+                       /* Lines below this line are auto-registered */
+                       if (streq(s, "$AUTOREGISTER"))
+                               state |= LSTAT_AUTOREGISTER;
+
                        /* Parse the expr */
                        v = process_pref_file_expr(&s, &f);
 
                        /* Set flag */
-                       state = (streq(v, "0") ? LSTAT_BYPASS : 0);
+                       if (streq(v, "0")) state |= LSTAT_BYPASS;
+                       else state &= ~LSTAT_BYPASS;
 
                        /* Re-update this line's state */
                        tb->states[y] = state | LSTAT_EXPRESSION;
@@ -3666,9 +4033,17 @@ static void draw_text_editor(text_body_type *tb)
                /* Erase line */
                Term_erase(0, i + 1, tb->wid);
 
-               /* Bypassed line will be displayed by darker color */
-               if (tb->states[y] & LSTAT_BYPASS) color = TERM_SLATE;
-               else color = TERM_WHITE;
+               if (tb->states[y] & LSTAT_AUTOREGISTER)
+               {
+                       /* Warning color -- These lines will be deleted later */
+                       color = TERM_L_RED;
+               }
+               else
+               {
+                       /* Bypassed line will be displayed by darker color */
+                       if (tb->states[y] & LSTAT_BYPASS) color = TERM_SLATE;
+                       else color = TERM_WHITE;
+               }
 
                if (!tb->mark)
                {
@@ -3800,10 +4175,17 @@ static void draw_text_editor(text_body_type *tb)
                                }
                                break;
 
-                       case 'A':
-                       case 'P':
-                       case 'C':
-                               if (tb->states[tb->cy] & LSTAT_BYPASS)
+                       default:
+                               if (tb->states[tb->cy] & LSTAT_AUTOREGISTER)
+                               {
+#ifdef JP
+                                       str = "¤³¤Î¹Ô¤Ï¸å¤Çºï½ü¤µ¤ì¤Þ¤¹¡£";
+#else
+                                       str = "This line will be delete later.";
+#endif
+                               }
+
+                               else if (tb->states[tb->cy] & LSTAT_BYPASS)
                                {
 #ifdef JP
                                        str = "¤³¤Î¹Ô¤Ï¸½ºß¤Ï̵¸ú¤Ê¾õÂ֤Ǥ¹¡£";
@@ -3827,6 +4209,15 @@ static void draw_text_editor(text_body_type *tb)
 
                        describe_autopick(buf, entry);
 
+                       if (tb->states[tb->cy] & LSTAT_AUTOREGISTER)
+                       {
+#ifdef JP
+                               strcat(buf, "¤³¤Î¹Ô¤Ï¸å¤Çºï½ü¤µ¤ì¤Þ¤¹¡£");
+#else
+                               strcat(buf, "  This line will be delete later.");
+#endif
+                       }
+
                        if (tb->states[tb->cy] & LSTAT_BYPASS)
                        {
 #ifdef JP
@@ -4978,7 +5369,7 @@ void do_cmd_edit_autopick(void)
        tb->last_destroyed = NULL;
        tb->dirty_flags = DIRTY_ALL | DIRTY_MODE | DIRTY_EXPRESSION;
        tb->dirty_line = -1;
-       tb->filename_mode = PT_WITH_PNAME;
+       tb->filename_mode = PT_DEFAULT;
 
        /* Autosave */
        if (turn > old_autosave_turn + 100L)
@@ -5203,26 +5594,10 @@ void do_cmd_edit_autopick(void)
        /* Restore the screen */
        screen_load();
 
-       switch (tb->filename_mode)
-       {
-       case PT_DEFAULT:
-#ifdef JP
-               strcpy(buf, "picktype.prf");
-#else
-               strcpy(buf, "pickpref.prf");
-#endif
-               break;
-
-       case PT_WITH_PNAME:
-#ifdef JP
-               sprintf(buf, "picktype-%s.prf", player_name);
-#else
-               sprintf(buf, "pickpref-%s.prf", player_name);
-#endif
-               break;
-       }
+       /* Get the filename of preference */
+       strcpy(buf, pickpref_filename(tb->filename_mode));
 
-       if (tb->changed && quit == QUIT_AND_SAVE)
+       if (quit == QUIT_AND_SAVE)
                write_text_lines(buf, tb->lines_list);
 
        free_text_lines(tb->lines_list);
index a9102d2..e42620f 100644 (file)
@@ -984,19 +984,70 @@ void do_cmd_destroy(void)
        o_ptr->number = old_number;
 
        /* Verify unless quantity given */
-       if (!force)
+       if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
        {
-               if (confirm_destroy || (object_value(o_ptr) > 0))
-               {
-                       /* Make a verification */
+               bool okay = TRUE;
+
+               /* Make a verification */
+               sprintf(out_val, 
 #ifdef JP
-               sprintf(out_val, "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? ", o_name);
+                       "ËÜÅö¤Ë%s¤ò²õ¤·¤Þ¤¹¤«? [y/n/Auto]",
 #else
-                       sprintf(out_val, "Really destroy %s? ", o_name);
+                       "Really destroy %s? [y/n/Auto]",
 #endif
+                       o_name);
+
+               msg_print(NULL);
+
+               /* Prompt */
+               prt(out_val, 0, 0);
+
+               /* HACK : Add the line to message buffer */
+               message_add(out_val);
+               p_ptr->window |= (PW_MESSAGE);
+               window_stuff();
+
+               /* Get an acceptable answer */
+               while (TRUE)
+               {
+                       char i = inkey();
+
+                       if (i == 'y' || i == 'Y')
+                       {
+                               okay = TRUE;
+                               break;
+                       }
+                       if (i == ESCAPE || i == 'n' || i == 'N')
+                       {
+                               /* Cancel */
+                               okay = FALSE;
+                               break;
+                       }
+                       if (i == 'a' || i == 'A')
+                       {
+                               int idx;
+
+                               /* Add an auto-destroy preference line */
+                               if (add_auto_register(o_ptr))
+                               {
+                                       /* Auto-destroy it */
+                                       idx = is_autopick(o_ptr);
+                                       auto_destroy_item(item, idx);
+                               }
+
+                               /* The object is already destroyed. */
+                               return;
+                       }
 
-                       if (!get_check(out_val)) return;
+                       /* Loop */
+                       continue;
                }
+
+               /* Erase the prompt */
+               prt("", 0, 0);
+
+               /* Cancelled */
+               if (!okay) return;
        }
 
        /* Take a turn */
index 80620ac..a903b1b 100644 (file)
@@ -5011,7 +5011,6 @@ extern int PlayerUID;
 /* Maximum "Nazguls" number */
 #define MAX_NAZGUL_NUM 5
 
-#define MAX_AUTOPICK 1009
 #define DO_AUTOPICK       0x01
 #define DO_AUTODESTROY    0x02
 #define DO_DISPLAY        0x04
index b052d1f..6bebc6c 100644 (file)
@@ -35,7 +35,8 @@ extern int level_up;
  *  List for auto-picker/destroyer entries
  */
 extern int max_autopick;
-extern autopick_type autopick_list[MAX_AUTOPICK];
+extern int max_max_autopick;
+extern autopick_type *autopick_list;
 
 /* tables.c */
 extern s16b ddd[9];
@@ -530,7 +531,7 @@ extern void auto_inscribe_item(int item, int idx);
 extern bool auto_destroy_item(int item, int autopick_idx);
 extern void delayed_auto_destroy(void);
 extern void auto_pickup_items(cave_type *c_ptr);
-extern void autopick_entry_from_object(autopick_type *entry, object_type *o_ptr);
+extern bool add_auto_register(object_type *o_ptr);
 extern void do_cmd_edit_autopick(void);
 
 /* birth.c */
index 10481e9..4dc06f3 100644 (file)
@@ -1010,6 +1010,15 @@ cptr process_pref_file_expr(cptr *sp, char *fp)
                                sprintf(tmp, "%02d", p_ptr->lev);
                                v = tmp;
                        }
+
+                       /* Autopick auto-register is in-use or not? */
+                       else if (streq(b+1, "AUTOREGISTER"))
+                       {
+                               if (p_ptr->autopick_autoregister)
+                                       v = "1";
+                               else
+                                       v = "0";
+                       }
                }
 
                /* Constant */
index 93e5138..07e13be 100644 (file)
@@ -1922,7 +1922,10 @@ note(format("
                rd_u32b(&p_ptr->special_defense);
        }
        rd_byte(&p_ptr->knowledge);
-       rd_byte(&tmp8u); /* oops */
+
+       rd_byte(&tmp8u);
+       p_ptr->autopick_autoregister = tmp8u ? TRUE : FALSE;
+
        rd_byte(&tmp8u); /* oops */
        rd_byte(&p_ptr->action);
        if (!z_older_than(10, 4, 3))
index 3f270db..fb08305 100644 (file)
@@ -718,7 +718,7 @@ static void wr_extra(void)
        wr_s16b(p_ptr->ele_immune);
        wr_u32b(p_ptr->special_defense);
        wr_byte(p_ptr->knowledge);
-       wr_byte(0);     /* oops */
+       wr_byte(p_ptr->autopick_autoregister);
        wr_byte(0);     /* oops */
        wr_byte(p_ptr->action);
        wr_byte(0);
index 9bc3fd4..54a5607 100644 (file)
@@ -1140,6 +1140,9 @@ struct player_type
        bool dtrap;               /* Whether you are on trap-safe grids */
        s16b floor_id;            /* Current floor location */ 
 
+       bool autopick_autoregister; /* auto register is in-use or not */
+
+
        /*** Temporary fields ***/
 
        bool playing;                   /* True if player is playing */
index 5ab8910..ff8efb7 100644 (file)
@@ -40,7 +40,8 @@ int level_up = 0;
  *  List for auto-picker/destroyer entries
  */
 int max_autopick = 0;
-autopick_type autopick_list[MAX_AUTOPICK];
+int max_max_autopick = 0;
+autopick_type *autopick_list = NULL;
 
 /*
  * Savefile version