OSDN Git Service

メインウィンドウの幅を大きくしたとき、アイテムリスト及び装備リストを表示に
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 29 Aug 2002 13:06:51 +0000 (13:06 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 29 Aug 2002 13:06:51 +0000 (13:06 +0000)
おいて配列外アクセスが起きてwindowsでは a) の位置のアイテム名が途中で切れる
という症状が出ていたバグを修正。

src/object1.c
src/variable.c

index b50d6ea..8882b10 100644 (file)
@@ -4539,7 +4539,7 @@ void display_equip(void)
 int show_inven(int target_item)
 {
        int             i, j, k, l, z = 0;
-       int             col, cur_col, len, lim;
+       int             col, cur_col, len;
        object_type     *o_ptr;
        char            o_name[MAX_NLEN];
        char            tmp_val[80];
@@ -4562,18 +4562,6 @@ int show_inven(int target_item)
        /* Default "max-length" */
        len = wid - col - 1;
 
-       /* Maximum space allowed for descriptions */
-       lim = wid - 4;
-
-       /* Require space for weight (if needed) */
-       if (show_weights) lim -= 9;
-
-       /* Require space for icon */
-       if (show_item_graph)
-       {
-               lim -= 2;
-               if (use_bigtile) lim--;
-       }
 
        /* Find the "final" slot */
        for (i = 0; i < INVEN_PACK; i++)
@@ -4618,9 +4606,6 @@ int show_inven(int target_item)
                /* Describe the object */
                object_desc(o_name, o_ptr, TRUE, 3);
 
-               /* Hack -- enforce max length */
-               o_name[lim] = '\0';
-
                /* Save the object index, color, and description */
                out_index[k] = i;
                out_color[k] = tval_to_attr[o_ptr->tval % 128];
@@ -4751,7 +4736,7 @@ int show_inven(int target_item)
 int show_equip(int target_item)
 {
        int             i, j, k, l;
-       int             col, cur_col, len, lim;
+       int             col, cur_col, len;
        object_type     *o_ptr;
        char            tmp_val[80];
        char            o_name[MAX_NLEN];
@@ -4771,26 +4756,6 @@ int show_equip(int target_item)
        /* Maximal length */
        len = wid - col - 1;
 
-       /* Maximum space allowed for descriptions */
-       lim = wid - 4;
-
-       /* Require space for labels (if needed) */
-#ifdef JP
-        if (show_labels) lim -= (7 + 2);
-#else
-       if (show_labels) lim -= (14 + 2);
-#endif
-
-
-       /* Require space for weight (if needed) */
-#ifdef JP
-        if (show_weights) lim -= 10;
-#else
-       if (show_weights) lim -= 9;
-#endif
-
-
-       if (show_item_graph) lim -= 2;
 
        /* Scan the equipment list */
        for (k = 0, i = INVEN_RARM; i < INVEN_TOTAL; i++)
@@ -4803,9 +4768,6 @@ int show_equip(int target_item)
                /* Description */
                object_desc(o_name, o_ptr, TRUE, 3);
 
-               /* Truncate the description */
-               o_name[lim] = 0;
-
                if ((i == INVEN_LARM) && p_ptr->ryoute)
                {
 #ifdef JP
@@ -6182,7 +6144,7 @@ int scan_floor(int *items, int y, int x, int mode)
 int show_floor(int target_item, int y, int x, int *min_width)
 {
        int i, j, k, l;
-       int col, len, lim;
+       int col, len;
 
        object_type *o_ptr;
 
@@ -6204,11 +6166,6 @@ int show_floor(int target_item, int y, int x, int *min_width)
        /* Default length */
        len = MAX((*min_width), 20);
 
-       /* Maximum space allowed for descriptions */
-       lim = wid - 4;
-
-       /* Require space for weight (if needed) */
-       if (show_weights) lim -= 9;
 
        /* Scan for objects in the grid, using item_tester_okay() */
        floor_num = scan_floor(floor_list, y, x, 0x01);
@@ -6221,9 +6178,6 @@ int show_floor(int target_item, int y, int x, int *min_width)
                /* Describe the object */
                object_desc(o_name, o_ptr, TRUE, 3);
 
-               /* Hack -- enforce max length */
-               o_name[lim] = '\0';
-
                /* Save the index */
                out_index[k] = i;
 
index 0206a91..c76998f 100644 (file)
@@ -96,10 +96,10 @@ s16b command_arg;           /* Gives argument of current command */
 s16b command_rep;              /* Gives repetition of current command */
 s16b command_dir;              /* Gives direction of current command */
 
-s16b command_see;              /* See "cmd1.c" */
-s16b command_wrk;              /* See "cmd1.c" */
+s16b command_see;              /* See "object1.c" */
+s16b command_wrk;              /* See "object1.c" */
 
-s16b command_gap = 50; /* See "cmd1.c" */
+s16b command_gap = 999;         /* See "object1.c" */
 
 s16b command_new;              /* Command chaining from inven/equip view */